diff options
author | David Shaw <[email protected]> | 2009-04-03 03:38:59 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2009-04-03 03:38:59 +0000 |
commit | a5b708ba9cf7eafac3b6942529a9c653669c1b1a (patch) | |
tree | b5788325e6cae0a061b5c10552f3344c3ed0dec3 | |
parent | * Makefile.am: Make srv.c part of libcompat instead of libutil. (diff) | |
download | gnupg-a5b708ba9cf7eafac3b6942529a9c653669c1b1a.tar.gz gnupg-a5b708ba9cf7eafac3b6942529a9c653669c1b1a.zip |
* http.c (connect_server): free (rather than xfree) the result of
getsrv().
-rw-r--r-- | util/ChangeLog | 3 | ||||
-rw-r--r-- | util/http.c | 6 |
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) { |