Fix a valgrind error
authorVolker Lendecke <vl@samba.org>
Sun, 2 Jan 2011 01:48:03 +0000 (02:48 +0100)
committerVolker Lendecke <vlendec@samba.org>
Sun, 2 Jan 2011 09:58:51 +0000 (10:58 +0100)
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

libcli/nbt/nbtname.c

index 3f0a1228e7a8f8a82cf5f9c3beaea19ddc7be164..fec8e8e9b9af3adc206ea3928904e8502afa46ba 100644 (file)
@@ -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);
        }