This patch fixes resource leak error reported
by coverity run.
CoverityID: 399700 ("Resource leak"): mount_utils.c
Test-Parameters: trivial testlist=conf-sanity
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Ib3281d922936822a0ac298a15d6e8863b3c2c9b7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52218
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (!end) {
fprintf(stderr, "%s: Invalid mount string: %s\n",
progname, s1);
- return NULL;
+ goto out_bad_mnt_str;
}
end--;
} else {
return converted;
out_free:
fprintf(stderr, "%s: Can't parse NID '%s'\n", progname, s1);
+out_bad_mnt_str:
free(converted);
return NULL;
}