From f01ea62408a2294c76cdddf1dcf1d95fef97c4a2 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Mon, 5 Mar 2018 01:29:16 -0500 Subject: [PATCH] LU-10766 utils: Correct error handling in llapi_dir_create Free dirpath if namepath allocation failed. Change-Id: If5c15219a28767e5c89b25a44b2ddaa907c5d12d Test-Parameters: trivial Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/31510 Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- lustre/utils/liblustreapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index a5c1347..e3e3e5c 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1034,7 +1034,7 @@ int llapi_dir_create(const char *name, mode_t mode, namepath = strdup(name); if (!namepath) { - free(namepath); + free(dirpath); free(lmu); return -ENOMEM; } -- 1.8.3.1