summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk5004.lee <mk5004.lee@samsung.com>2019-01-28 06:11:50 (GMT)
committermk5004.lee <mk5004.lee@samsung.com>2019-01-29 01:30:10 (GMT)
commitbc1d931eda640c8ce8978b0a1407fd014fb8894b (patch)
tree77cc4d77ef6f5860c9c14a37148252dcf0dc7477
parent7744158a94cb8fb806c78ecb72c51db12007d498 (diff)
downloadbadge-bc1d931eda640c8ce8978b0a1407fd014fb8894b.zip
badge-bc1d931eda640c8ce8978b0a1407fd014fb8894b.tar.gz
badge-bc1d931eda640c8ce8978b0a1407fd014fb8894b.tar.bz2
Fix resource leaksrefs/changes/16/198616/3
Change-Id: Ibb14f9c271d4a3b030763f745b4f23ebff3647a4 Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
-rw-r--r--src/badge_internal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/badge_internal.c b/src/badge_internal.c
index 701f7b4..6d2b66a 100644
--- a/src/badge_internal.c
+++ b/src/badge_internal.c
@@ -530,6 +530,8 @@ int _badge_insert(badge_h *badge, uid_t uid)
goto return_close_db;
}
+ sqlite3_free(sqlbuf);
+
sqlbuf = sqlite3_mprintf("INSERT INTO %q " \
"(pkgname, uid) VALUES (%Q, %d);",
BADGE_OPTION_TABLE_NAME,
@@ -619,6 +621,8 @@ int _badge_remove(const char *caller, const char *pkgname, uid_t uid, pid_t pid)
goto return_close_db;
}
+ sqlite3_free(sqlbuf);
+
sqlbuf = sqlite3_mprintf("DELETE FROM %q WHERE pkgname = %Q AND uid = %d",
BADGE_OPTION_TABLE_NAME, pkgname, uid);
if (!sqlbuf) {
@@ -688,6 +692,8 @@ static int _badge_remove_by_appid(const char *appid, uid_t uid, sqlite3 *db)
goto return_close_db;
}
+ sqlite3_free(sqlbuf);
+
sqlbuf = sqlite3_mprintf("DELETE FROM %q WHERE pkgname = %Q AND uid = %d",
BADGE_OPTION_TABLE_NAME, appid, uid);
if (!sqlbuf) {