mgmt/glusterd: Fix memory leaks in glusterd-handler.c

Addresses the following CIDs:

1370941: Unconditional memory leak in glusterd_print_snapinfo_by_vol()
1370943: Memory leak when opendir fails for output directory in
glusterd_get_state()

Change-Id: I9536841629e1ffe1fed79a8e57d266a0e953e5af
updates: bz#789278
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Vijay Bellur 2018-08-21 22:16:07 -07:00 committed by Amar Tumballi
parent 5ab6e2ce11
commit 4d3be30729

View File

@ -5136,7 +5136,7 @@ glusterd_print_snapinfo_by_vol (FILE *fp, glusterd_volinfo_t *volinfo, int volco
fprintf (fp, "Volume%d.snapshot%d.name: %s\n",
volcount, snapcount, snapinfo->snapname);
fprintf (fp, "Volume%d.snapshot%d.id: %s\n", volcount, snapcount,
gf_strdup (uuid_utoa (snapinfo->snap_id)));
uuid_utoa (snapinfo->snap_id));
fprintf (fp, "Volume%d.snapshot%d.time: %s\n",
volcount, snapcount, timestr);
@ -5401,6 +5401,7 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
GD_MSG_DICT_GET_FAILED, "%s", err_str);
}
GF_FREE (odir);
ret = -1;
goto out;
}