/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-15 19:35:03 UTC
  • Revision ID: teddy@recompile.se-20140715193503-e18hls7m4rv4l6iq
mandos-client: Fix mem free bug.

* plugins.d/mandos-client.c (add_server): Hide warning.
  (main): Free server->ip too, not just the server struct.

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
  ret = clock_gettime(CLOCK_MONOTONIC, &(new_server->last_seen));
241
241
  if(ret == -1){
242
242
    perror_plus("clock_gettime");
243
 
    free(new_server->ip);
 
243
#ifdef __GNUC__
 
244
#pragma GCC diagnostic push
 
245
#pragma GCC diagnostic ignored "-Wcast-qual"
 
246
#endif
 
247
    free((char *)(new_server->ip));
 
248
#ifdef __GNUC__
 
249
#pragma GCC diagnostic pop
 
250
#endif
244
251
    free(new_server);
245
252
    return false;
246
253
  }
2549
2556
    mc.current_server->prev->next = NULL;
2550
2557
    while(mc.current_server != NULL){
2551
2558
      server *next = mc.current_server->next;
 
2559
#ifdef __GNUC__
 
2560
#pragma GCC diagnostic push
 
2561
#pragma GCC diagnostic ignored "-Wcast-qual"
 
2562
#endif
 
2563
      free((char *)(mc.current_server->ip));
 
2564
#ifdef __GNUC__
 
2565
#pragma GCC diagnostic pop
 
2566
#endif
2552
2567
      free(mc.current_server);
2553
2568
      mc.current_server = next;
2554
2569
    }