From aae05afe01d4d937338709c22bee625ac13c2254 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Feb 2010 20:22:42 -0800 Subject: [PATCH] MISSING VALUES: Fix free of indeterminate pointer. If the main "while" loop in this function falls through immediately without ever executing its body, then 'v' is passed to free() without ever being initialized. Found by Clang (http://clang-analyzer.llvm.org). --- src/language/dictionary/missing-values.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/language/dictionary/missing-values.c b/src/language/dictionary/missing-values.c index 819b0a90..22fe4436 100644 --- a/src/language/dictionary/missing-values.c +++ b/src/language/dictionary/missing-values.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ int cmd_missing_values (struct lexer *lexer, struct dataset *ds) { - struct variable **v; + struct variable **v = NULL; size_t nv; int retval = CMD_FAILURE; -- 2.30.2