s3: Fix bug 7202
authorVolker Lendecke <vl@samba.org>
Sat, 20 Mar 2010 14:23:17 +0000 (15:23 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 29 Mar 2010 07:41:05 +0000 (09:41 +0200)
Make sure _nss_wins_gethostbyname_r has a talloc stackframe available

Thanks to Sergey Tereschenko <serg.partizan@gmail.com> for reporting the bug!

Volker
(cherry picked from commit 3c68414b2fe1e8db66469b4b6374b26b5fe9fbcb)

nsswitch/wins.c

index 80f01191080c46ea136867773060f30603aaade8..aa95ec7340956cbf70bd5d8a3a66da71042e1e76 100644 (file)
@@ -333,11 +333,14 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
        int i, count;
        fstring name;
        size_t namelen;
+       TALLOC_CTX *frame;
 
 #if HAVE_PTHREAD
        pthread_mutex_lock(&wins_nss_mutex);
 #endif
 
+       frame = talloc_stackframe();
+
        memset(he, '\0', sizeof(*he));
        fstrcpy(name, hostname);
 
@@ -421,6 +424,8 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
 
   out:
 
+       TALLOC_FREE(frame);
+
 #if HAVE_PTHREAD
        pthread_mutex_unlock(&wins_nss_mutex);
 #endif