From: wwp Date: Sat, 17 Mar 2018 18:34:05 +0000 (+0100) Subject: Fix wrong malloc of clamd_socket struct, CID 1220477. X-Git-Tag: 3.17.0~175 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=f4cb29891be3d0a74191064680ddade59344c076 Fix wrong malloc of clamd_socket struct, CID 1220477. --- diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c index 6f1cc59e5..23358e52f 100644 --- a/src/plugins/clamd/libclamd/clamd-plugin.c +++ b/src/plugins/clamd/libclamd/clamd-plugin.c @@ -138,7 +138,7 @@ void clamd_create_config_automatic(const gchar* path) { value = g_strdup(g_strchomp(tmp)); if (strcmp(clamd_tokens[0], token) == 0) { /* UNIX socket */ - Socket = (Clamd_Socket *) malloc(sizeof(Clamd_Socket *)); + Socket = (Clamd_Socket *) malloc(sizeof(Clamd_Socket)); if (Socket) { Socket->socket.host = NULL; Socket->socket.port = -1; @@ -154,7 +154,7 @@ void clamd_create_config_automatic(const gchar* path) { else if (strcmp(clamd_tokens[1], token) == 0) { /* INET socket */ if (! Socket) { - Socket = (Clamd_Socket *) malloc(sizeof(Clamd_Socket *)); + Socket = (Clamd_Socket *) malloc(sizeof(Clamd_Socket)); if (Socket) { Socket->socket.path = NULL; Socket->socket.port = -1;