/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-07-13 20:37:44 UTC
  • mfrom: (237.7.258 trunk)
  • Revision ID: teddy@recompile.se-20140713203744-538hqhk81vw9dixv
MergeĀ fromĀ trunk.

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
 
#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
 
243
    free(new_server->ip);
251
244
    free(new_server);
252
245
    return false;
253
246
  }
1076
1069
     timed out */
1077
1070
  
1078
1071
  if(quit_now){
1079
 
    avahi_s_service_resolver_free(r);
1080
1072
    return;
1081
1073
  }
1082
1074
  
1653
1645
      int status;
1654
1646
      if(TEMP_FAILURE_RETRY(waitpid(hook_pid, &status, 0)) == -1){
1655
1647
        perror_plus("waitpid");
1656
 
        free(direntry);
1657
1648
        continue;
1658
1649
      }
1659
1650
      if(WIFEXITED(status)){
1661
1652
          fprintf_plus(stderr, "Warning: network hook \"%s\" exited"
1662
1653
                       " with status %d\n", direntry->d_name,
1663
1654
                       WEXITSTATUS(status));
1664
 
          free(direntry);
1665
1655
          continue;
1666
1656
        }
1667
1657
      } else if(WIFSIGNALED(status)){
1668
1658
        fprintf_plus(stderr, "Warning: network hook \"%s\" died by"
1669
1659
                     " signal %d\n", direntry->d_name,
1670
1660
                     WTERMSIG(status));
1671
 
        free(direntry);
1672
1661
        continue;
1673
1662
      } else {
1674
1663
        fprintf_plus(stderr, "Warning: network hook \"%s\""
1675
1664
                     " crashed\n", direntry->d_name);
1676
 
        free(direntry);
1677
1665
        continue;
1678
1666
      }
1679
1667
    }
1681
1669
      fprintf_plus(stderr, "Network hook \"%s\" ran successfully\n",
1682
1670
                   direntry->d_name);
1683
1671
    }
1684
 
    free(direntry);
1685
1672
  }
1686
1673
  free(direntries);
1687
1674
  if((int)TEMP_FAILURE_RETRY(close(hookdir_fd)) == -1){
2281
2268
        if(ret_errno != 0){
2282
2269
          errno = ret_errno;
2283
2270
          perror_plus("argz_add");
2284
 
          free(direntries[i]);
2285
2271
          continue;
2286
2272
        }
2287
2273
        if(debug){
2288
2274
          fprintf_plus(stderr, "Will use interface \"%s\"\n",
2289
2275
                       direntries[i]->d_name);
2290
2276
        }
2291
 
        free(direntries[i]);
2292
2277
      }
2293
2278
      free(direntries);
2294
2279
    } else {
2564
2549
    mc.current_server->prev->next = NULL;
2565
2550
    while(mc.current_server != NULL){
2566
2551
      server *next = mc.current_server->next;
2567
 
#ifdef __GNUC__
2568
 
#pragma GCC diagnostic push
2569
 
#pragma GCC diagnostic ignored "-Wcast-qual"
2570
 
#endif
2571
 
      free((char *)(mc.current_server->ip));
2572
 
#ifdef __GNUC__
2573
 
#pragma GCC diagnostic pop
2574
 
#endif
2575
2552
      free(mc.current_server);
2576
2553
      mc.current_server = next;
2577
2554
    }
2646
2623
                         " \"%s\", 0): %s\n", tempdir,
2647
2624
                         direntries[i]->d_name, strerror(errno));
2648
2625
          }
2649
 
          free(direntries[i]);
2650
2626
        }
2651
2627
        
2652
2628
        /* need to clean even if 0 because man page doesn't specify */