Module: kamailio
Branch: 5.6
Commit: 315781e547e359354b6deaf53355a029fdb3e869
URL:
https://github.com/kamailio/kamailio/commit/315781e547e359354b6deaf53355a02…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-06-22T12:47:18+02:00
core: fix freeaddrinfo coredump
#0 __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007fbb5e515537 in __GI_abort () at abort.c:79
#2 0x00007fbb5e56e768 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7fbb5e67ce2d "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007fbb5e575a5a in malloc_printerr (str=str@entry=0x7fbb5e67b05a "free():
invalid pointer") at malloc.c:5347
#4 0x00007fbb5e576c14 in _int_free (av=<optimized out>, p=<optimized out>,
have_lock=0) at malloc.c:4173
#5 0x00007fbb5e5d8da0 in __GI_freeaddrinfo (ai=ai@entry=0x7fbb5e83ba10) at
../sysdeps/posix/getaddrinfo.c:2520
#6 0x000055ba099dcd0b in log_init () at core/dprint.c:482
#7 0x000055ba09970d7a in main (argc=10, argv=0x7ffde85a1788) at main.c:2055
(cherry picked from commit 71502d2bb733340db310bf4e0c47e4b194f49113)
---
Modified: src/core/dprint.c
---
Diff:
https://github.com/kamailio/kamailio/commit/315781e547e359354b6deaf53355a02…
Patch:
https://github.com/kamailio/kamailio/commit/315781e547e359354b6deaf53355a02…
---
diff --git a/src/core/dprint.c b/src/core/dprint.c
index 9b01dc8af9a..f4780bb4d47 100644
--- a/src/core/dprint.c
+++ b/src/core/dprint.c
@@ -459,7 +459,8 @@ static str log_prefix_str = STR_NULL;
void log_init(void)
{
- struct addrinfo hints, *info;
+ struct addrinfo hints;
+ struct addrinfo *info = NULL;
int gai_result;
char hostname[1024];