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, 22 Mar 2010 09:16:15 +0000 (10:16 +0100)
Make sure _nss_wins_gethostbyname_r has a talloc stackframe available

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

Volker

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