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

merge + small bugfix

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
  if (new_plugin == NULL){
106
106
    return NULL;
107
107
  }
108
 
  char *copy_name = strdup(name);
 
108
  char *copy_name = NULL;
 
109
  if(name != NULL){
 
110
    copy_name = strdup(name);
 
111
  }
109
112
  if(copy_name == NULL){
110
113
    return NULL;
111
114
  }
118
121
  
119
122
  new_plugin->argv = malloc(sizeof(char *) * 2);
120
123
  if (new_plugin->argv == NULL){
 
124
    free(copy_name);
121
125
    free(new_plugin);
122
126
    return NULL;
123
127
  }
126
130
 
127
131
  new_plugin->environ = malloc(sizeof(char *));
128
132
  if(new_plugin->environ == NULL){
 
133
    free(copy_name);
129
134
    free(new_plugin->argv);
130
135
    free(new_plugin);
131
136
    return NULL;