Skip to content

Commit

Permalink
Free pt before the function CommandLine_run returns.
Browse files Browse the repository at this point in the history
The function `ProcessTable_new` will return a ProcessTable object. 
In function `CommandLine_run`, the pointer pt at line 28 is not freed before the function returns. While pt->super is passed to functions at lines 30 and 89, this doesn't transfer ownership of the entire pt structure. There is no explicit free operation for pt in the function, resulting in a memory leak.
Thus, we delete the pointer `pt` at the end of the function.
  • Loading branch information
mugitya03 authored Feb 26, 2025
1 parent 96b8ddc commit 817de95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CommandLine.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,6 @@ int CommandLine_run(int argc, char** argv) {
DynamicColumns_delete(dc);
DynamicMeters_delete(dm);
DynamicScreens_delete(ds);

ProcessTable_delete(pt);
return 0;
}

0 comments on commit 817de95

Please sign in to comment.