Mercurial > pidgin
diff libpurple/protocols/zephyr/ZSendPkt.c @ 23557:aaaff38e144f
Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 17 Jul 2008 04:38:07 +0000 |
parents | 5fe8042783c1 |
children | 05d3447fb34e |
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/ZSendPkt.c Wed Jul 16 09:16:52 2008 +0000 +++ b/libpurple/protocols/zephyr/ZSendPkt.c Thu Jul 17 04:38:07 2008 +0000 @@ -5,12 +5,12 @@ * * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology. * For copying and distribution information, see the file - * "mit-copyright.h". + * "mit-copyright.h". */ #include "internal.h" #ifdef WIN32 -#include <winsock.h> +#include <winsock2.h> #else #include <sys/socket.h> #endif @@ -25,19 +25,19 @@ Code_t retval; struct sockaddr_in dest; ZNotice_t notice, acknotice; - + if (!packet || len < 0) return (ZERR_ILLVAL); if (len > Z_MAXPKTLEN) return (ZERR_PKTLEN); - + if (ZGetFD() < 0) if ((retval = ZOpenPort((unsigned short *)0)) != ZERR_NONE) return (retval); dest = ZGetDestAddr(); - + if (sendto(ZGetFD(), packet, len, 0, (struct sockaddr *)&dest, sizeof(dest)) < 0) return (errno); @@ -47,7 +47,7 @@ if ((retval = ZParseNotice(packet, len, ¬ice)) != ZERR_NONE) return (retval); - + retval = Z_WaitForNotice (&acknotice, wait_for_hmack, ¬ice.z_uid, HM_TIMEOUT); if (retval == ETIMEDOUT)