From fd6c856b34c8fda53b7e45e3dcc17625206ed4fb Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 Jul 2011 17:35:29 +0400 Subject: Add workaround for clang under linux. Fix problems found by static analyzing. --- src/lua/lua_classifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lua/lua_classifier.c') diff --git a/src/lua/lua_classifier.c b/src/lua/lua_classifier.c index 4e868b7f7..82fd4948d 100644 --- a/src/lua/lua_classifier.c +++ b/src/lua/lua_classifier.c @@ -72,7 +72,7 @@ lua_check_classifier (lua_State * L) { void *ud = luaL_checkudata (L, 1, "rspamd{classifier}"); luaL_argcheck (L, ud != NULL, 1, "'classifier' expected"); - return *((struct classifier_config **)ud); + return ud ? *((struct classifier_config **)ud) : NULL; } static GList * @@ -353,7 +353,7 @@ lua_check_statfile (lua_State * L) { void *ud = luaL_checkudata (L, 1, "rspamd{statfile}"); luaL_argcheck (L, ud != NULL, 1, "'statfile' expected"); - return *((struct statfile **)ud); + return ud ? *((struct statfile **)ud) : NULL; } -- cgit v1.2.3