summaryrefslogtreecommitdiffstats
path: root/source3/lib/util_sock.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-01-21 18:01:55 +0100
committerKai Blin <kai@samba.org>2008-01-21 18:02:24 +0100
commit36e3e75e0683eb9fd14d8a282d9a2324f01fddf7 (patch)
treed56440f8ededd2a5c731f9edd5b7bdf28cf25dec /source3/lib/util_sock.c
parent9a226532221b88369b913bc9f9d6ec335620349f (diff)
downloadsamba-36e3e75e0683eb9fd14d8a282d9a2324f01fddf7.tar.gz
samba-36e3e75e0683eb9fd14d8a282d9a2324f01fddf7.tar.xz
samba-36e3e75e0683eb9fd14d8a282d9a2324f01fddf7.zip
util_sock: Don't return a pointer to freed memory.
Fix a bug in my bugfix. Thanks to vl for spotting that one. (This used to be commit 24f68b90cca111256a7b03f7062cb57c2b08a0d6)
Diffstat (limited to 'source3/lib/util_sock.c')
-rw-r--r--source3/lib/util_sock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index f524d0d8262..a3975f6c1f2 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -2083,7 +2083,8 @@ const char *get_mydnsfullname(void)
if (!memcache_lookup(NULL, SINGLETON_CACHE,
data_blob_string_const("get_mydnsfullname"),
&tmp)) {
- tmp = data_blob_string_const(res->ai_canonname);
+ tmp = data_blob_talloc(talloc_tos(), res->ai_canonname,
+ strlen(res->ai_canonname) + 1);
}
freeaddrinfo(res);