Skip to content

Commit

Permalink
fix: obvious use-after-free
Browse files Browse the repository at this point in the history
Signed-off-by: William Henderson <[email protected]>
  • Loading branch information
w-henderson committed Aug 2, 2023
1 parent cc0b0e1 commit 4880697
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion samples/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,11 @@ read_migr_data(int sock, void *buf, size_t len)

memcpy(buf, res->data, res->size);

uint32_t size = res->size;

free(res);

return res->size;
return size;
}

static int
Expand Down

0 comments on commit 4880697

Please sign in to comment.