diff options
author | Miles Bader <miles@gnu.org> | 1996-07-19 20:19:12 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-07-19 20:19:12 +0000 |
commit | ee777fc3c34092f5e8f620ba22df2dd8cc6e5be3 (patch) | |
tree | 846be0d73290e904cb58f8a5c8d02710cfe04759 /libstore/decode.c | |
parent | c33b41fef7bafdd163992f51f63eb67adfe6eeab (diff) |
(store_std_leaf_decode): Decode name too.
Diffstat (limited to 'libstore/decode.c')
-rw-r--r-- | libstore/decode.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; } |