summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-02 02:48:03 +0100
committerVolker Lendecke <vlendec@samba.org>2011-01-02 10:58:51 +0100
commit41179c2538b38eafc52ac5355d2c4becdd9c87d4 (patch)
tree163fea7cbb4c93e598ae8fdf4a324d9731e7a032 /libcli
parent9d754da1120d21e7e1021ca0366cceedca0ee823 (diff)
downloadsamba-41179c2538b38eafc52ac5355d2c4becdd9c87d4.tar.gz
samba-41179c2538b38eafc52ac5355d2c4becdd9c87d4.tar.bz2
samba-41179c2538b38eafc52ac5355d2c4becdd9c87d4.zip
Fix a valgrind error
Thanks to Tridge for the hint. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Jan 2 10:58:51 CET 2011 on sn-devel-104
Diffstat (limited to 'libcli')
-rw-r--r--libcli/nbt/nbtname.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c
index 3f0a1228e7..fec8e8e9b9 100644
--- a/libcli/nbt/nbtname.c
+++ b/libcli/nbt/nbtname.c
@@ -83,7 +83,9 @@ static enum ndr_err_code ndr_pull_component(struct ndr_pull *ndr,
return ndr_pull_error(ndr, NDR_ERR_STRING,
"BAD NBT NAME component");
}
- *component = (uint8_t*)talloc_strndup(ndr, (const char *)&ndr->data[1 + *offset], len);
+ *component = (uint8_t*)talloc_strndup(
+ ndr->current_mem_ctx,
+ (const char *)&ndr->data[1 + *offset], len);
NDR_ERR_HAVE_NO_MEMORY(*component);
*offset += len + 1;
*max_offset = MAX(*max_offset, *offset);
@@ -127,7 +129,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_nbt_string(struct ndr_pull *ndr, int ndr_fla
"BAD NBT NAME too many components");
}
if (num_components == 0) {
- name = talloc_strdup(ndr, "");
+ name = talloc_strdup(ndr->current_mem_ctx, "");
NDR_ERR_HAVE_NO_MEMORY(name);
}