X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fpkgmgrinfo_db.c;h=e382bf5398b61b0872cb175d7c55bb1c0c750de8;hb=49943f233bb83f85148a88989035b82103499001;hp=0075ff1fd1079c978abd7ba38cc053616cf20ed2;hpb=c167c513fa3e91619344cf73675b75886dd016b1;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git diff --git a/src/pkgmgrinfo_db.c b/src/pkgmgrinfo_db.c index 0075ff1..e382bf5 100644 --- a/src/pkgmgrinfo_db.c +++ b/src/pkgmgrinfo_db.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include @@ -58,6 +59,7 @@ static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid) if (fd == -1) { _LOGE("FAIL : open %s : %s", dir, strerror_r(errno, buf, sizeof(buf))); + free(fullpath); return -1; } ret = fstat(fd, &sb); @@ -65,11 +67,13 @@ static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid) _LOGE("FAIL : fstat %s : %s", dir, strerror_r(errno, buf, sizeof(buf))); close(fd); + free(fullpath); return -1; } if (S_ISLNK(sb.st_mode)) { _LOGE("FAIL : %s is symlink!", dir); close(fd); + free(fullpath); return -1; } ret = fchown(fd, uid, gid); @@ -77,6 +81,7 @@ static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid) _LOGE("FAIL : fchown %s %d.%d, because %s", dir, uid, gid, strerror_r(errno, buf, sizeof(buf))); close(fd); + free(fullpath); return -1; } close(fd);