neels submitted this change.
fix leak in ranap_new_transp_layer_addr()
Like BIT_STRING_fromBuf(), free any buffer previously kept in the target
BIT_STRING_t.
Context: osmo-hnbgw calls ranap_new_transp_layer_addr() to replace an
address in a decoded message, before re-encoding it. So far doing so
leaked the previous buffer.
Change-Id: Ic92fa317644c3a1f2be9badf455d34fe0b8ea2a4
---
M src/iu_helpers.c
1 file changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 6e2c203..718c30a 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -217,6 +217,8 @@
buf = CALLOC(len, sizeof(uint8_t));
memcpy(buf, ip_addr, ip_len);
}
+ if (out->buf)
+ FREEMEM(out->buf);
out->buf = buf;
out->size = len;
out->bits_unused = 0;
To view, visit change 32613. To unsubscribe, or for help writing mail filters, visit settings.