email plugin: fix check for result of malloc
[collectd.git] / src / email.c
index 0e34b89..ca4dbc2 100644 (file)
@@ -534,7 +534,7 @@ static void *open_connection (void __attribute__((unused)) *arg)
                }
 
                connection = malloc (sizeof (*connection));
-               if (connection != NULL)
+               if (connection == NULL)
                {
                        close (remote);
                        continue;