diff options
author | Volker Lendecke <vl@samba.org> | 2011-01-02 02:48:03 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-03-05 14:34:48 +0100 |
commit | e1bf4fda6afd6d002c4741252e90ffed4b0faf66 (patch) | |
tree | 72899a4647c343a35c0b87815783322ade4a45f4 | |
parent | d7eb70adaccabf0d5c4f095ccadec87e86bee4e7 (diff) | |
download | samba-e1bf4fda6afd6d002c4741252e90ffed4b0faf66.tar.gz samba-e1bf4fda6afd6d002c4741252e90ffed4b0faf66.tar.xz samba-e1bf4fda6afd6d002c4741252e90ffed4b0faf66.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
(cherry picked from commit 23693fe3c51ac89db64fefed292f7e4ff38e00e8)
-rw-r--r-- | libcli/nbt/nbtname.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c index 338cb210897..5346ee3e8e1 100644 --- a/libcli/nbt/nbtname.c +++ b/libcli/nbt/nbtname.c @@ -82,7 +82,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); @@ -126,7 +128,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); } |