From ff57e5d728c2f409b8852ee58d622c2c3323e2a8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 26 Jun 2006 17:30:22 +0000 Subject: From Patch #6046 freeaddrinfo() in error handling return (Peter Breitenlohner) --- ChangeLog | 6 ++++++ src/sm_genid.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3185f5f..9254bd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-26 Alan Coopersmith + + * src/sm_genid.c: + From Patch #6046 + freeaddrinfo() in error handling return (Peter Breitenlohner) + 2006-04-26 Adam Jackson * configure.ac: diff --git a/src/sm_genid.c b/src/sm_genid.c index 76e1350..bf06644 100644 --- a/src/sm_genid.c +++ b/src/sm_genid.c @@ -179,8 +179,12 @@ SmsGenerateClientID (smsConn) { ptr2 = strchr (ptr1, '.'); len = ptr2 - ptr1; - if (!ptr2 || len > 3) + if (!ptr2 || len > 3) { +#if defined(IPv6) && defined(AF_INET6) + freeaddrinfo(first_ai); +#endif return (NULL); + } strncpy (temp, ptr1, len); temp[len] = '\0'; decimal[i] = atoi (temp); -- cgit v1.2.3