[sr-dev] [kamailio/kamailio] detailed_ipv4_type func pkg memory leak. (Issue #3159)

杰哥 notifications at github.com
Thu Jun 23 03:01:10 CEST 2022


### Description

when call detailed_ipv4_type function, pkg memory leak.
```c
detailed_ipv4_type($si,"$var(iptype)");
```


### Troubleshooting

#### Reproduction
just call detailed_ipv4_type function.

#### Debugging Data

```
ALERT: qm_sums: qm_sums():  count= 48161 size=   1789640 bytes from core: core/rvalue.c: rval_get_str(1293)

```

### Possible Solutions

ip address string not free in rval_get_str() function. [s->s=pkg_malloc(tmp.len+1/* 0 term */);](https://github.com/kamailio/kamailio/blob/1ddc27f199061025a6a43da3e8a1388fcaddfe19/src/core/rvalue.c#L1293)
need call pkg_free() free memory.

### Additional Information
test 3 version.
```
kamailio 5.5.4
kamailio 5.4.8
kamailio 5.3.9
```

* **Operating System**:
```
buster 10
ubuntu 20.04
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3159
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3159 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220622/3121814e/attachment.htm>


More information about the sr-dev mailing list