Bug 4455 - Potential memory leak in string_table_new()
Summary: Potential memory leak in string_table_new()
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.18.0
Hardware: PC Windows 10
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2021-03-05 08:49 UTC by Avinash Sonawane
Modified: 2021-03-05 09:47 UTC (History)
1 user (show)

See Also:


Attachments

Description Avinash Sonawane 2021-03-05 08:49:01 UTC
Hello!

In src/common/strimngtable.c string_table_new() at Line no. 67 there is a potential memory leak.

If `strtable->hash_table` is `NULL` and so `cm_return_val_if_fail(strtable->hash_table, NULL)` macro expands to return NULL exiting the string_table_new() then the memory pointed by `strtable` (allocate via g_new0 L64) remains to be freed and hence leaked.

Found by scan-build https://clang-analyzer.llvm.org/scan-build.html
Comment 1 Michael Rasmussen 2021-03-05 09:32:15 UTC
See commit 42570f284bce910152a3f5182aca6f860dd788a0

Note You need to log in before you can comment on or make changes to this bug.