From ee777fc3c34092f5e8f620ba22df2dd8cc6e5be3 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 19 Jul 1996 20:19:12 +0000 Subject: (store_std_leaf_decode): Decode name too. --- libstore/decode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libstore') diff --git a/libstore/decode.c b/libstore/decode.c index 791f7a1a..cf169d02 100644 --- a/libstore/decode.c +++ b/libstore/decode.c @@ -35,7 +35,7 @@ store_std_leaf_decode (struct store_enc *enc, store_std_leaf_create_t create, struct store **store) { - char *misc; + char *misc, *name; error_t err; int type, flags, i; mach_port_t port; @@ -65,6 +65,13 @@ store_std_leaf_decode (struct store_enc *enc, if (! misc) return ENOMEM; + name = strdup (enc->data + enc->cur_data); + if (! name) + { + free (misc); + return ENOMEM; + } + /* Read encoded ports (be careful to deallocate this if we barf). */ port = enc->ports[enc->cur_port++]; @@ -106,10 +113,12 @@ store_std_leaf_decode (struct store_enc *enc, { mach_port_deallocate (mach_task_self (), port); free (misc); + free (name); } else { (*store)->flags = flags; + (*store)->name = name; (*store)->misc = misc; (*store)->misc_len = misc_len; } -- cgit v1.2.3