Skip to content

Commit

Permalink
libosdp: Fix memory leak when file ops is registered
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Aug 14, 2024
1 parent 77a30f5 commit c396ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/osdp_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@ void osdp_cp_teardown(osdp_t *ctx)
if (is_capture_enabled(pd)) {
osdp_packet_capture_finish(pd);
}
safe_free(pd->file);
}

safe_free(osdp_to_pd(ctx, 0));
Expand Down
1 change: 1 addition & 0 deletions src/osdp_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ void osdp_pd_teardown(osdp_t *ctx)
}

#ifndef CONFIG_OSDP_STATIC_PD
safe_free(pd->file);
safe_free(pd);
safe_free(ctx);
#endif
Expand Down

0 comments on commit c396ed6

Please sign in to comment.