features/marker: Cleanup loc in case of errors

Missing loc_wipe() for error paths in mq_readdir_cbk() can
cause memory leaks. loc_wipe() is now done for both happy
and unhappy paths.

Change-Id: I882aa5dcca06e25b56a828767fb2b91a1efaf83b
BUG: 1227904
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/11074
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
This commit is contained in:
Vijay Bellur 2015-06-03 23:43:55 +05:30 committed by Raghavendra G
parent f1c20897cc
commit d2d7afefd8

View File

@ -660,12 +660,10 @@ mq_readdir_cbk (call_frame_t *frame,
&loc, dict);
offset = entry->d_off;
loc_wipe (&loc);
newframe = NULL;
out:
loc_wipe (&loc);
if (dict) {
dict_unref (dict);
dict = NULL;