From def3dd7f37150657e1b41a2df8a563a93394a518 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 19 Mar 2012 14:07:14 +0530 Subject: libglusterfs/call-stub: ref dict while storing it in readdirp stub Change-Id: I11224f7afa2e87dc242cc2e9e865c7ab2bb88c7e BUG: 765785 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.com/2974 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/call-stub.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c index cdae9df251e..9b3a9c34849 100644 --- a/libglusterfs/src/call-stub.c +++ b/libglusterfs/src/call-stub.c @@ -1868,7 +1868,9 @@ fop_readdirp_stub (call_frame_t *frame, stub->args.readdirp.fd = fd_ref (fd); stub->args.readdirp.size = size; stub->args.readdirp.off = off; - stub->args.readdirp.dict = dict; + if (dict != NULL) { + stub->args.readdirp.dict = dict_ref (dict); + } out: return stub; @@ -3642,6 +3644,10 @@ call_stub_destroy_wind (call_stub_t *stub) { if (stub->args.readdirp.fd) fd_unref (stub->args.readdirp.fd); + + if (stub->args.readdirp.dict) + dict_unref (stub->args.readdirp.dict); + break; } -- cgit