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 8898c08..ea4e785 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;