/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2014-06-13 22:13:56 UTC
  • mto: (237.7.272 trunk)
  • mto: This revision was merged to the branch mainline in revision 317.
  • Revision ID: teddy@recompile.se-20140613221356-b9c36ctxmw4pelja
Fix free() of possibly uninitialized pointer in mandos-client.

* plugins.d/mandos-client (main): Initialize "direntries" to NULL so
                                  it can be free()'d even if scandir()
                                  fails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2253
2253
  
2254
2254
  /* If no interfaces were specified, make a list */
2255
2255
  if(mc.interfaces == NULL){
2256
 
    struct dirent **direntries;
 
2256
    struct dirent **direntries = NULL;
2257
2257
    /* Look for any good interfaces */
2258
2258
    ret = scandir(sys_class_net, &direntries, good_interface,
2259
2259
                  alphasort);