[Commits] [SCM] claws branch, master, updated. 3.18.0-135-ga96ead9bf

wwp at claws-mail.org wwp at claws-mail.org
Thu Sep 16 00:43:55 CEST 2021


The branch, master has been updated
       via  a96ead9bf3f7d4e5ae8371d95cf841b3db19607f (commit)
      from  d6cdfd3bafb0cc30bddada4360688ad6e52bbc65 (commit)

Summary of changes:
 src/plugins/clamd/libclamd/clamd-plugin.c | 4 ++++
 1 file changed, 4 insertions(+)


- Log -----------------------------------------------------------------
commit a96ead9bf3f7d4e5ae8371d95cf841b3db19607f
Author: wwp <subscript at free.fr>
Date:   Thu Sep 16 00:43:08 2021 +0200

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

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c
index 858ca0436..58255c431 100644
--- 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) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list