aboutsummaryrefslogtreecommitdiffstats
path: root/util/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/http.c')
-rw-r--r--util/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/http.c b/util/http.c
index 5013ae6c1..e176821b8 100644
--- a/util/http.c
+++ b/util/http.c
@@ -856,7 +856,9 @@ connect_server( const char *server, ushort port, unsigned int flags,
{
/* Either we're not using SRV, or the SRV lookup failed. Make
up a fake SRV record. */
- srvlist=xmalloc_clear(sizeof(struct srventry));
+ srvlist=calloc(1,sizeof(struct srventry));
+ if(!srvlist)
+ return -1;
srvlist->port=port;
strncpy(srvlist->target,server,MAXDNAME);
srvlist->target[MAXDNAME-1]='\0';
@@ -959,7 +961,7 @@ connect_server( const char *server, ushort port, unsigned int flags,
}
#endif /* !HAVE_GETADDRINFO */
- xfree(srvlist);
+ free(srvlist);
if(!connected)
{