diff options
author | Jung Jihoon <jh8801.jung@samsung.com> | 2019-07-09 16:19:19 +0900 |
---|---|---|
committer | Jung Jihoon <jh8801.jung@samsung.com> | 2019-07-09 16:42:12 +0900 |
commit | cfe9b8e72274e9583b38013e7d33e9a874c93603 (patch) | |
tree | e6e40226ebb2a9094a95cf6ea8474e9211e7c8e2 | |
parent | 251c336fda46e4eaf4df52cb0ab03640889ac813 (diff) | |
download | mtp-responder-cfe9b8e72274e9583b38013e7d33e9a874c93603.tar.gz mtp-responder-cfe9b8e72274e9583b38013e7d33e9a874c93603.tar.bz2 mtp-responder-cfe9b8e72274e9583b38013e7d33e9a874c93603.zip |
Fix Coverity issue : 1048215 Resource leak
Change-Id: I7b35b6e85206df2df5d0db801356105cdda968af
Signed-off-by: Jung Jihoon <jh8801.jung@samsung.com>
-rw-r--r-- | src/mtp_init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mtp_init.c b/src/mtp_init.c index 8f767ec..e0681e2 100644 --- a/src/mtp_init.c +++ b/src/mtp_init.c @@ -135,8 +135,12 @@ void _mtp_init(add_rem_store_t sel) } sync_partner = vconf_get_str(VCONFKEY_MTP_SYNC_PARTNER_STR); - if (sync_partner != NULL && strlen(sync_partner) > 0) { - _device_set_sync_partner(sync_partner); + if (sync_partner != NULL) { + if (strlen(sync_partner) > 0) + _device_set_sync_partner(sync_partner); + else + _device_set_sync_partner(MTP_DEV_PROPERTY_SYNCPARTNER); + g_free(sync_partner); } else { _device_set_sync_partner(MTP_DEV_PROPERTY_SYNCPARTNER); |