summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-16 14:48:39 +0200
committerVolker Lendecke <vlendec@samba.org>2011-06-05 15:17:42 +0200
commit13ac91d9a1e695aa5b4147bc13c728eb1cb562e8 (patch)
tree4b1125bcb0f7976e362c5a31ecaf417947dc49ac /nsswitch
parent10f5fa8a1e2272cf2388277b17e00082b2973216 (diff)
downloadsamba-13ac91d9a1e695aa5b4147bc13c728eb1cb562e8.tar.gz
samba-13ac91d9a1e695aa5b4147bc13c728eb1cb562e8.tar.bz2
samba-13ac91d9a1e695aa5b4147bc13c728eb1cb562e8.zip
nss_wins: Add a stackframe to lookup_byname_backend()
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Jun 5 15:17:42 CEST 2011 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/wins.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index 1bfdcd9fd5..5c9ad2fb05 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -59,6 +59,7 @@ static void nss_wins_init(void)
static struct in_addr *lookup_byname_backend(const char *name, int *count)
{
+ TALLOC_CTX *frame = talloc_stackframe();
struct ip_service *address = NULL;
struct in_addr *ret = NULL;
int j;
@@ -73,16 +74,19 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
if (NT_STATUS_IS_OK(resolve_wins(name,0x00,&address,count))) {
if ( (ret = SMB_MALLOC_P(struct in_addr)) == NULL ) {
free( address );
+ TALLOC_FREE(frame);
return NULL;
}
if (address[0].ss.ss_family != AF_INET) {
free(address);
free(ret);
+ TALLOC_FREE(frame);
return NULL;
}
*ret = ((struct sockaddr_in *)(void *)&address[0].ss)
->sin_addr;
free( address );
+ TALLOC_FREE(frame);
return ret;
}
@@ -98,17 +102,17 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
}
in_addr_to_sockaddr_storage(&ss, *bcast);
status = name_query(name, 0x00, True, True, &ss,
- NULL, &pss, count, NULL);
+ talloc_tos(), &pss, count, NULL);
if (NT_STATUS_IS_OK(status) && (*count > 0)) {
if ((ret = SMB_MALLOC_P(struct in_addr)) == NULL) {
+ TALLOC_FREE(frame);
return NULL;
}
*ret = ((struct sockaddr_in *)pss)->sin_addr;
- TALLOC_FREE(pss);
break;
}
}
-
+ TALLOC_FREE(frame);
return ret;
}