summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin <beber@meleeweb.net>2012-12-04 12:47:54 +0100
committerBertrand Jacquin <beber@meleeweb.net>2012-12-04 12:47:54 +0100
commit79aa35db15fe44197c9ea376066c40196c245973 (patch)
tree8d6e109cd5ef26fb7ac17e06f2f9a4c0eea45c83
parent[CLEANUP] Reindent open braces (diff)
downloadmod_virtualvalue-79aa35db15fe44197c9ea376066c40196c245973.tar.gz
[CLEANUP] Avoid null derefence
$ make clean shared CC=clang CFLAGS=--analyze HAVE_PHP=Yes V=1 .. clang -c -fPIC -pthread -I/usr/include/apr-1 -I/usr/include/apache2 -DHAVE_PHP -I/usr/lib64/php5.4/include/php -I/usr/lib64/php5.4/include/php/main -I/usr/lib64/php5.4/include/php/TSRM -I/usr/lib64/php5.4/include/php/Zend -I/usr/lib64/php5.4/include/php/ext -I/usr/lib64/php5.4/include/php/ext/date/lib --analyze -o mod_virtualvalue.o mod_virtualvalue.c mod_virtualvalue.c:476:10: warning: Access to field 'tok' results in a dereference of a null pointer (loaded from variable 'n') n->tok = argv[0]; ~ ^ 1 warning generated.
-rw-r--r--mod_virtualvalue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mod_virtualvalue.c b/mod_virtualvalue.c
index 5914047..c2c607c 100644
--- a/mod_virtualvalue.c
+++ b/mod_virtualvalue.c
@@ -463,6 +463,9 @@ static const char *vv_set (cmd_parms *cmd, void *struct_ptr __U__, int argc, cha
n = vv_var_new ();
+ if (!n)
+ return NULL;
+
if (!c->vars) {
c->vars = n;
}