From 6f9f49dbd62f0889fbbbbc249d1ae33f4e91269e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 6 Jun 2012 01:50:42 +0100 Subject: [PATCH] fix an uninit'd variable --- cprogs/xacpi-simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cprogs/xacpi-simple.c b/cprogs/xacpi-simple.c index 70949b9..f2ba491 100644 --- a/cprogs/xacpi-simple.c +++ b/cprogs/xacpi-simple.c @@ -357,7 +357,7 @@ static double total_##f; ALL_ACCUMULATE_FIELDS(Q_VAR) static void acquiredata(void) { - DIR *di; + DIR *di = 0; struct dirent *de; int r; @@ -427,7 +427,7 @@ ALL_PLAIN_ACCUMULATE_FIELDS(Q_ACCUMULATE_PLAIN) } - closedir(di); + if (di) closedir(di); if (debug) { printf("TOTAL:\n"); -- 2.30.2