File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ void tep_plugin_remove_options(struct tep_plugin_option *options)
254
254
}
255
255
}
256
256
257
- static void parse_option_name (char * * option , char * * plugin )
257
+ static int parse_option_name (char * * option , char * * plugin )
258
258
{
259
259
char * p ;
260
260
@@ -265,8 +265,9 @@ static void parse_option_name(char **option, char **plugin)
265
265
* p = '\0' ;
266
266
* option = strdup (p + 1 );
267
267
if (!* option )
268
- return ;
268
+ return -1 ;
269
269
}
270
+ return 0 ;
270
271
}
271
272
272
273
static struct tep_plugin_option *
@@ -325,7 +326,8 @@ int tep_plugin_add_option(const char *name, const char *val)
325
326
if (!option_str )
326
327
return - ENOMEM ;
327
328
328
- parse_option_name (& option_str , & plugin );
329
+ if (parse_option_name (& option_str , & plugin ) < 0 )
330
+ return - ENOMEM ;
329
331
330
332
/* If the option exists, update the val */
331
333
for (op = trace_plugin_options ; op ; op = op -> next ) {
You can’t perform that action at this time.
0 commit comments