From: tappro Date: Fri, 8 Sep 2006 07:00:49 +0000 (+0000) Subject: fix memleak X-Git-Tag: v1_8_0_110~486^2~983 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=037a24035297fbb8b4c7662668b7f9c9c65e156e;p=fs%2Flustre-release.git fix memleak --- diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index b2b888a..9ff6eb2 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1280,7 +1280,7 @@ static int mgs_write_log_mdt0(struct obd_device *obd, struct fs_db *fsdb, /* add MDT itself */ rc = record_start_log(obd, &llh, log); if (rc) - RETURN(rc); + GOTO(out, rc); /* FIXME this whole fn should be a single journal transaction */ rc = record_marker(obd, llh, fsdb, CM_START, log, "add mdt"); @@ -1289,9 +1289,9 @@ static int mgs_write_log_mdt0(struct obd_device *obd, struct fs_db *fsdb, rc = record_setup(obd, llh, log, uuid, mdt_index, lovname, 0); rc = record_marker(obd, llh, fsdb, CM_END, log, "add mdt"); rc = record_end_log(obd, &llh); - +out: name_destroy(lovname); - OBD_FREE(uuid, sizeof(*uuid)); + OBD_FREE(uuid, sizeof(struct obd_uuid)); RETURN(rc); }