colord/backport-0002-CVE-2021-42523.patch

26 lines
887 B
Diff
Raw Normal View History

2022-08-31 10:14:24 +08:00
From 1452a975ecae14299fb27d41522dfd32305481ce Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Wed, 13 Apr 2022 14:21:32 +0100
Subject: [PATCH] trivial: Fix a small memory leak on db open failure
2022-08-29 11:01:35 +08:00
2022-08-31 10:14:24 +08:00
Conflict:Using g_autofree will make the testcase fail, so here we use sqlite3_free to free the memory
Reference:https://github.com/hughsie/colord/commit/1452a975ecae14299fb27d41522dfd32305481ce
2022-08-29 11:01:35 +08:00
---
2022-08-31 10:14:24 +08:00
src/cd-profile-db.c | 1 +
1 file changed, 1 insertion(+)
2022-08-29 11:01:35 +08:00
2022-08-31 10:14:24 +08:00
diff --git a/src/cd-profile-db.c b/src/cd-profile-db.c
index 5661d09..d6361ac 100644
--- a/src/cd-profile-db.c
+++ b/src/cd-profile-db.c
@@ -87,6 +87,7 @@ cd_profile_db_load (CdProfileDb *pdb,
"uid INTEGER,"
"value TEXT,"
"PRIMARY KEY (profile_id, property, uid));";
+ sqlite3_free (error_msg);
sqlite3_exec (priv->db, statement, NULL, NULL, NULL);
}
return TRUE;
--
2.33.0