Code

email plugin: malloc + memset -> calloc
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:50:42 +0000 (15:50 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 13:50:42 +0000 (15:50 +0200)
src/email.c

index 8898c087020c84d465f42d1569abb193b9230890..ea4e7850138060891d132f5e3a46ecc6ca2cd35d 100644 (file)
@@ -537,13 +537,12 @@ static void *open_connection (void __attribute__((unused)) *arg)
                        break;
                }
 
-               connection = malloc (sizeof (*connection));
+               connection = calloc (1, sizeof (*connection));
                if (connection == NULL)
                {
                        close (remote);
                        continue;
                }
-               memset (connection, 0, sizeof (*connection));
 
                connection->socket = fdopen (remote, "r");
                connection->next   = NULL;