/mandos/trunk

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

« back to all changes in this revision

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

  • Committer: Teddy Hogeborn
  • Date: 2014-07-12 13:13:28 UTC
  • Revision ID: teddy@recompile.se-20140712131328-gdkvcea7f9rov7bn
mandos-client: Fix minor memory leak on memory full or clock failure.

* plugins.d/mandos-client.c (add_server): On any errors, free
                                          new_server and its contents
                                          before returning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
                          .af = af };
235
235
  if(new_server->ip == NULL){
236
236
    perror_plus("strdup");
 
237
    free(new_server);
237
238
    return false;
238
239
  }
239
240
  ret = clock_gettime(CLOCK_MONOTONIC, &(new_server->last_seen));
240
241
  if(ret == -1){
241
242
    perror_plus("clock_gettime");
 
243
    free(new_server->ip);
 
244
    free(new_server);
242
245
    return false;
243
246
  }
244
247
  /* Special case of first server */