/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 plugin-runner.c

  • Committer: teddy at recompile
  • Date: 2020-01-12 01:53:04 UTC
  • Revision ID: teddy@recompile.se-20200112015304-gqif9w4pbyix8w6b
mandos-ctl: Fix minor bug in tests

Fix two tests, the last assert of which would always erroneously
succeed.  (No change in non-test code needed.)

* mandos-ctl (Test_dbus_python_adapter_SystemBus): In the
  test_call_method_handles_exception() method, fix check for
  dbus.ConnectFailed exception.
  (Test_pydbus_adapter_SystemBus): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
313
313
__attribute__((nonnull))
314
314
static void free_plugin(plugin *plugin_node){
315
315
  
316
 
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
 
316
  for(char **arg = (plugin_node->argv)+1; *arg != NULL; arg++){
317
317
    free(*arg);
318
318
  }
 
319
  free(plugin_node->name);
319
320
  free(plugin_node->argv);
320
321
  for(char **env = plugin_node->environ; *env != NULL; env++){
321
322
    free(*env);
564
565
    case '?':                   /* --help */
565
566
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
566
567
      argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP);
 
568
      __builtin_unreachable();
567
569
    case -3:                    /* --usage */
568
570
      state->flags &= ~(unsigned int)ARGP_NO_EXIT; /* force exit */
569
571
      argp_state_help(state, state->out_stream,
570
572
                      ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
 
573
      __builtin_unreachable();
571
574
    case 'V':                   /* --version */
572
575
      fprintf(state->out_stream, "%s\n", argp_program_version);
573
576
      exit(EXIT_SUCCESS);
583
586
      if(arg[0] == '\0'){
584
587
        break;
585
588
      }
586
 
      /* FALLTHROUGH */
 
589
#if __GNUC__ >= 7
 
590
      __attribute__((fallthrough));
 
591
#else
 
592
          /* FALLTHROUGH */
 
593
#endif
587
594
    default:
588
595
      return ARGP_ERR_UNKNOWN;
589
596
    }