[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-193-g2d39e4b7a

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


The branch, gtk3 has been updated
       via  2d39e4b7aaae907241103a23fc003737ba9eba69 (commit)
      from  5618ef004fa350901e9b09fb9c742b6216dfc5d0 (commit)

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


- Log -----------------------------------------------------------------
commit 2d39e4b7aaae907241103a23fc003737ba9eba69
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