ModemManager/0004-shared-qmi-fix-a-leak-in-error-handling-path.patch
Lubomir Rintel 471d385cd1 Add patches for a couple of bugs that make static analysis unhappy
Real bugs, but no security implications. Let's check the boxes and fix
them, to reduce the static analysis tooling noise.

Resolves: https://issues.redhat.com/browse/RHEL-38991
2024-06-25 10:52:15 +02:00

31 lines
830 B
Diff

From 4a3542b2d00c4104e9735af9eea906c703faed20 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 23 May 2024 14:56:40 +0200
Subject: [PATCH 04/11] shared-qmi: fix a leak in error handling path
str needs to be freed in pds_get_agps_config_ready().
---
src/mm-shared-qmi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index 923c6b51a..789b92a4d 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -4795,9 +4795,10 @@ pds_get_agps_config_ready (QmiClientPds *client,
str = g_strdup ("");
out:
- if (error)
+ if (error) {
+ g_free (str);
g_task_return_error (task, error);
- else {
+ } else {
g_assert (str);
g_task_return_pointer (task, str, g_free);
}
--
2.45.2