In cb_mv_init(), set *dirp to NULL if the parent cannot be opened.
This will avoid a double free when closedir() is called a second
time on the way out of llapi_semantic_traverse()
Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Change-Id: I115137f01cd4e370f4ef766028ad9269e85ed10a
Reviewed-on: http://review.whamcloud.com/9905
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
if (parent == NULL) {
dir = opendir_parent(path);
if (dir == NULL) {
+ *dirp = NULL;
ret = -errno;
- fprintf(stderr, "can not open %s ret %d\n",
- path, ret);
+ llapi_error(LLAPI_MSG_ERROR, ret,
+ "can not open %s\n", path);
return ret;
}
}