Skip to content

Commit

Permalink
Add missing ENOMEM check
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Svetlitski <[email protected]>
  • Loading branch information
Svetlitski committed Nov 23, 2021
1 parent 27b872c commit 0201cd6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libdrgn/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ struct drgn_error *drgn_program_cache_thread(struct drgn_program *prog,
if (err)
return err;
struct drgn_thread *thread = malloc(sizeof(struct drgn_thread));
if (!thread)
return &drgn_enomem;
*thread = (struct drgn_thread){ .tid = entry.key, .prstatus = { data, size } };
if (drgn_thread_map_size(&prog->thread_map) == 0) {
// Having perused the GDB, BFD, and Kernel source code, it appears that
Expand Down

0 comments on commit 0201cd6

Please sign in to comment.