summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac7b4bd)
raw | patch | inline | side by side (parent: ac7b4bd)
author | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 10:56:09 +0000 (11:56 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 10:56:09 +0000 (11:56 +0100) |
CID: 38010
src/email.c | patch | blob | history |
diff --git a/src/email.c b/src/email.c
index fdcf0677837e25cb27e50e78ad6c69f17be7bc3c..7493cc6d6967bc07255d7fb91a12bb5a6039974b 100644 (file)
--- a/src/email.c
+++ b/src/email.c
}
} while (EINTR == errno);
- connection = (conn_t *)smalloc (sizeof (conn_t));
+ connection = malloc (sizeof (*connection));
+ if (connection != NULL)
+ {
+ close (remote);
+ continue;
+ }
+ memset (connection, 0, sizeof (*connection));
connection->socket = fdopen (remote, "r");
connection->next = NULL;
if (NULL == connection->socket) {
close (remote);
+ sfree (connection);
continue;
}