Skip to content

Commit

Permalink
struct hist: Also record the history for "NULL" objects
Browse files Browse the repository at this point in the history
While the history of a "NULL" object isn't much of a rich/useful piece
of information, allowing it may help prevent errors in some cases, due
to "sh_push()" returning an unexpected NULL value => crash.

(cherry picked from commit cad9bd0)
  • Loading branch information
liviuchircu committed Feb 8, 2023
1 parent 3c64738 commit 2af4676
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dbg/struct_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct struct_hist *_sh_push(void *obj, struct struct_hist_list *list, int refs)
{
struct struct_hist *sh, *last;

if (!obj || !list)
if (!list)
return NULL;

sh = shm_malloc(sizeof *sh);
Expand Down

0 comments on commit 2af4676

Please sign in to comment.