Whamcloud - gitweb
LU-10766 utils: Correct error handling in llapi_dir_create 10/31510/4
authorOleg Drokin <oleg.drokin@intel.com>
Mon, 5 Mar 2018 06:29:16 +0000 (01:29 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 14 Apr 2018 12:14:55 +0000 (12:14 +0000)
Free dirpath if namepath allocation failed.

Change-Id: If5c15219a28767e5c89b25a44b2ddaa907c5d12d
Test-Parameters: trivial
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: https://review.whamcloud.com/31510
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/utils/liblustreapi.c

index a5c1347..e3e3e5c 100644 (file)
@@ -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;
        }