From 305ce520ae9005ba121d46652d5c9fef955f9c24 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 15 Dec 2011 13:22:02 +0000 Subject: [PATCH] fix a segfault and improve debug build --- daemon/Makefile | 3 ++- daemon/call.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/Makefile b/daemon/Makefile index 32e5dd91b..c9a90d713 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -6,7 +6,6 @@ CC= gcc CFLAGS= -g -Wall `pkg-config --cflags glib-2.0` `pcre-config --cflags` -fno-strict-aliasing CFLAGS+= -I/lib/modules/`uname -r`/build/include/ -I../kernel-module/ CFLAGS+= -D_GNU_SOURCE -CFLAGS+= -O2 ifeq ($(REDIS),yes) CFLAGS+= -I$(LIBREDISDIR) @@ -16,6 +15,8 @@ endif ifeq ($(DBG),yes) CFLAGS+= -D__DEBUG=1 +else +CFLAGS+= -O2 endif LDFLAGS= `pkg-config --libs glib-2.0` `pcre-config --libs` diff --git a/daemon/call.c b/daemon/call.c index 7d296e4ff..f68deec15 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1174,7 +1174,7 @@ static struct call *call_get_or_create(const char *callid, struct callmaster *m) static int addr_parse_udp(struct stream *st, const char **o) { u_int32_t ip4; - ZERO(st); + ZERO(*st); if (o[5] && *o[5]) { ip4 = inet_addr(o[5]); if (ip4 == -1)