diff mbox series

[2/2] qmi: voicecall: Add free on the error path

Message ID 20240429212640.11474-2-denkenz@gmail.com (mailing list archive)
State Accepted
Commit 3365880efc45e70c6fe914ad8c1619c8e935888d
Headers show
Series [1/2] qmi: voicecall: Reflow the logic to avoid nesting | expand

Commit Message

Denis Kenzior April 29, 2024, 9:26 p.m. UTC
send_one_dtmf() allocates cb_data, but does not properly clean it up on
the (rather unlikely) error path.
---
 drivers/qmimodem/voicecall.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/qmimodem/voicecall.c b/drivers/qmimodem/voicecall.c
index bb4c4c2ce204..c6383a563b6e 100644
--- a/drivers/qmimodem/voicecall.c
+++ b/drivers/qmimodem/voicecall.c
@@ -682,6 +682,7 @@  static void send_one_dtmf(struct ofono_voicecall *vc, const char dtmf,
 error:
 	CALLBACK_WITH_FAILURE(cb, data);
 	l_free(param);
+	cb_data_unref(cbd);
 }
 
 static void send_one_dtmf_cb(const struct ofono_error *error, void *data)