talons

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

commit f4cb29891be3d0a74191064680ddade59344c076
parent 2d03eb98268e11b12c698bb6f98c7fb2f3559e3b
Author: wwp <wwp@free.fr>
Date:   Sat, 17 Mar 2018 19:34:05 +0100

Fix wrong malloc of clamd_socket struct, CID 1220477.

Diffstat:
Msrc/plugins/clamd/libclamd/clamd-plugin.c | 4++--
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;