summaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
authorilho <ilho159.kim@samsung.com>2019-01-28 16:52:32 +0900
committerilho <ilho159.kim@samsung.com>2019-01-29 08:48:54 +0900
commit0fafb8fc43226c8d46d11fed13f8d36939789ddc (patch)
tree8b180a03787e5b11c664171fe67a617dccf3ea59 /installer
parent4c32134904ec51ae3eec8e8c86438e5e4bdd185f (diff)
downloadslp-pkgmgr-0fafb8fc43226c8d46d11fed13f8d36939789ddc.tar.gz
slp-pkgmgr-0fafb8fc43226c8d46d11fed13f8d36939789ddc.tar.bz2
slp-pkgmgr-0fafb8fc43226c8d46d11fed13f8d36939789ddc.zip
Fix possibility of double free
Change-Id: I907211b9896d3de040c4da76778c942ff7890c75 Signed-off-by: ilho <ilho159.kim@samsung.com>
Diffstat (limited to 'installer')
-rw-r--r--installer/pkgmgr_installer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/installer/pkgmgr_installer.c b/installer/pkgmgr_installer.c
index a15485f..f69db39 100644
--- a/installer/pkgmgr_installer.c
+++ b/installer/pkgmgr_installer.c
@@ -459,10 +459,12 @@ pkgmgr_installer_receive_request(pkgmgr_installer *pi,
free(pi->pkgmgr_info);
pi->pkgmgr_info = strndup(optarg, MAX_STRLEN);
DBG("option is [i] pkgid[%s]", pi->pkgmgr_info);
- if (pi->pkgmgr_info && strlen(pi->pkgmgr_info) == 0)
+ if (pi->pkgmgr_info && strlen(pi->pkgmgr_info) == 0) {
free(pi->pkgmgr_info);
- else
+ pi->pkgmgr_info = NULL;
+ } else {
mode = 'i';
+ }
break;
case 'e': /* install */