summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaeyoung <ty317.kim@samsung.com>2016-09-21 12:42:58 +0900
committerJung <pr.jung@samsung.com>2016-09-20 21:45:58 -0700
commit7ed3be422288071007c2b9066caadd19f34ae5ab (patch)
treec5ff40712bd964174080c56128ab67c5fc1581eb
parentd919151830ab4b4eb38cad79f17b692b47c1c6d7 (diff)
downloaddeviced-7ed3be422288071007c2b9066caadd19f34ae5ab.tar.gz
deviced-7ed3be422288071007c2b9066caadd19f34ae5ab.tar.bz2
deviced-7ed3be422288071007c2b9066caadd19f34ae5ab.zip
- memory leak - uninitialized variable - memory release sequence Change-Id: I9a4271bf4a83029e5ce4dd9f38be1cdb2fa7682f Signed-off-by: taeyoung <ty317.kim@samsung.com>
-rw-r--r--src/libdeviced/usbhost.c1
-rw-r--r--src/usbhost/usb-host.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libdeviced/usbhost.c b/src/libdeviced/usbhost.c
index cf00e69c..1cb0d1d4 100644
--- a/src/libdeviced/usbhost.c
+++ b/src/libdeviced/usbhost.c
@@ -71,6 +71,7 @@ static int register_edbus_signal_handler(const char *path, const char *interface
handler = calloc(1, sizeof(*handler));
if (!handler) {
_E("No memory");
+ ret = -1;
goto out;
}
handler->name = name;
diff --git a/src/usbhost/usb-host.c b/src/usbhost/usb-host.c
index 83e26384..16d65df8 100644
--- a/src/usbhost/usb-host.c
+++ b/src/usbhost/usb-host.c
@@ -609,9 +609,8 @@ static int store_policy(void)
fd = open(POLICY_FILEPATH, O_WRONLY | O_CREAT, 0664);
if (fd < 0) {
- ret = -errno;
_E("Could not open policy file for writing: %m");
- goto out;
+ return -errno;
}
DD_LIST_FOREACH(access_list, elem, entry) {
@@ -684,8 +683,8 @@ static int read_policy(void)
value_str);
if (ret == EOF) {
_E("Error reading line: %m");
- free(entry);
free(entry->creds.sec_label);
+ free(entry);
goto out;
}