Skip to content

Commit

Permalink
don't pass NULL pointer to strdup()
Browse files Browse the repository at this point in the history
  • Loading branch information
darealshinji authored Oct 31, 2023
1 parent dcad007 commit e8f835b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion checkrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ char *find_symbol(mmap_t *mem, const char *sym_prefix)
}
}

return strdup(symbol);
return symbol ? strdup(symbol) : NULL;
}

/* mmap() library and look for symbol by prefix */
Expand Down

0 comments on commit e8f835b

Please sign in to comment.