commit 72c9f2413c835b60b09cfecf898a7483539f3367
parent e4274cfcd78d8039995c4f897e3f900ac3c7987e
Author: wwp <wwp@free.fr>
Date: Sat, 17 Mar 2018 19:34:05 +0100
Fix wrong malloc of clamd_socket struct, CID 1220477.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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;