Fix wrong malloc of clamd_socket struct, CID 1220477.
[claws.git] / src / plugins / clamd / libclamd / clamd-plugin.c
index 6f1cc59e5aecfff3ddf0effbcb0021f596f21ef5..23358e52f59446d5bf0400ff0044b8d738a58b57 100644 (file)
@@ -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;