aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/ChangeLog3
-rw-r--r--util/http.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index 6906fbc96..47559ce5b 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,5 +1,8 @@
2009-04-02 David Shaw <[email protected]>
+ * http.c (connect_server): free (rather than xfree) the result of
+ getsrv().
+
* Makefile.am: Make srv.c part of libcompat instead of libutil.
* srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ
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)
{