Holger Freyther has submitted this change and it was merged. (
https://gerrit.osmocom.org/9417 )
Change subject: mobile/sms: Fix memory leak in case the storage can not be
opened
......................................................................
mobile/sms: Fix memory leak in case the storage can not be opened
Before jumping to the failure handling code free the sms_file.
Change-Id: Ifce2bc130fe3a5bd49ad457ee61002952dd496ba
---
M src/host/layer23/src/mobile/gsm411_sms.c
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
Vadim Yanitskiy: Looks good to me, but someone else must approve
Harald Welte: Looks good to me, approved
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c
b/src/host/layer23/src/mobile/gsm411_sms.c
index 9090697..3eca48a 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -213,8 +213,10 @@
snprintf(sms_file, len, "%s/%s", home, osmocomsms);
fp = fopen(sms_file, "a");
- if (!fp)
+ if (!fp) {
+ talloc_free(sms_file);
goto fail;
+ }
fprintf(fp, "[SMS from %s]\n%s\n", gsms->address, gsms->text);
fclose(fp);
--
To view, visit https://gerrit.osmocom.org/9417
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifce2bc130fe3a5bd49ad457ee61002952dd496ba
Gerrit-Change-Number: 9417
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Holger Freyther <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>