Skip to content

Commit

Permalink
sources/instance.c: handle strdup failures
Browse files Browse the repository at this point in the history
Signed-off-by: Ilia Shipitsin <[email protected]>
  • Loading branch information
chipitsine committed Aug 1, 2024
1 parent 60fd462 commit b08addc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sources/instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ int od_instance_main(od_instance_t *instance, int argc, char **argv)
return NOT_OK_RESPONSE;
}
instance->exec_path = strdup(argv[0]);
if (instance->exec_path == NULL) {
return NOT_OK_RESPONSE;
}
/* validate command line options */
int argindx; // index of fisrt unparsed indx
if (argp_parse(&argp, argc, argv, 0, &argindx, &args) != OK_RESPONSE) {
Expand Down

0 comments on commit b08addc

Please sign in to comment.