talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit a96ead9bf3f7d4e5ae8371d95cf841b3db19607f
parent d6cdfd3bafb0cc30bddada4360688ad6e52bbc65
Author: wwp <subscript@free.fr>
Date:   Thu, 16 Sep 2021 00:43:08 +0200

Fix CID 1491141, 149246: resource leaks.
Fix CID 1491291: ensure string in buffer is 0-ended.

Diffstat:
Msrc/plugins/clamd/libclamd/clamd-plugin.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c @@ -212,6 +212,8 @@ void clamd_create_config_automatic(const gchar* path) { } } claws_fclose(conf); + if (value) + g_free(value); if (! (Socket && (Socket->socket.port || Socket->socket.path))) { /*g_error("%s: Not able to find required information", path);*/ alertpanel_error(_("%s: Not able to find required information\nclamd will be disabled"), path); @@ -603,11 +605,13 @@ GSList* clamd_verify_dir(const gchar* path) { if (write(sock, command, strlen(command)) == -1) { debug_print("write error %d\n", errno); close(sock); + g_free(command); return list; } g_free(command); memset(buf, '\0', sizeof(buf)); while ((n_read = read(sock, buf, BUFSIZ - 1)) > 0) { + buf[n_read] = 0; gchar** tmp = g_strsplit(buf, "\n", 0); gchar** head = tmp; while (*tmp) {