[Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c,1.49,1.50

Andreas T�nnesen (spam-protected)
Thu Sep 14 10:03:32 CEST 2006


Update of /cvsroot/olsrd/olsrd-current/src/cfgparser
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32221/src/cfgparser

Modified Files:
	olsrd_conf.c 
Log Message:
Check for NULL return for malloc

Index: olsrd_conf.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** olsrd_conf.c	17 Apr 2006 18:31:09 -0000	1.49
--- olsrd_conf.c	14 Sep 2006 08:03:29 -0000	1.50
***************
*** 111,115 ****
        fprintf(stderr, "Out of memory %s\n", __func__);
        return NULL;
!   }
  
    set_default_cnf(cnf);
--- 111,115 ----
        fprintf(stderr, "Out of memory %s\n", __func__);
        return NULL;
!     }
  
    set_default_cnf(cnf);
***************
*** 125,129 ****
        free(cnf);
        return NULL;
!   }
  
    current_line = 1;
--- 125,129 ----
        free(cnf);
        return NULL;
!     }
  
    current_line = 1;
***************
*** 427,431 ****
        fprintf(stderr, "Out of memory %s\n", __func__);
        return NULL;
!   }
  
    set_default_cnf(cnf);
--- 427,431 ----
        fprintf(stderr, "Out of memory %s\n", __func__);
        return NULL;
!     }
  
    set_default_cnf(cnf);
***************
*** 486,490 ****
    struct if_config_options *io = malloc(sizeof(struct if_config_options));
    struct in6_addr in6;
!  
    memset(io, 0, sizeof(struct if_config_options));
  
--- 486,496 ----
    struct if_config_options *io = malloc(sizeof(struct if_config_options));
    struct in6_addr in6;
! 
!   if(io == NULL)
!     {
!       fprintf(stderr, "Out of memory %s\n", __func__);
!       return NULL;
!     }
! 
    memset(io, 0, sizeof(struct if_config_options));
  





More information about the Olsr-cvs mailing list