[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#613277: anna: [DACA] popen+fclose should be popen+pclose



Package: anna
Version 1.39
Severity: minor
Tag: patch

DACA reports a mismatching allocation and deallocation in util.c:

  http://qa.debian.org/daca/cppcheck/sid/anna_1.39.html

Right, popen should be used together with pclose.

Patch attached.

--- anna-1.39/util.c.orig	2009-07-23 19:43:25.000000000 +0200
+++ anna-1.39/util.c	2011-02-13 21:35:34.548412831 +0100
@@ -208,13 +208,13 @@
 	if (fp == NULL)
 		return 0;
 	if (fgets(line, sizeof(line), fp) != NULL) {
-		fclose(fp);
+		pclose(fp);
 		if (strlen(line) < 32)
 			return 0;
 		line[32] = '\0';
 		return !strcmp(line, sum);
 	}
-	fclose(fp);
+	pclose(fp);
 	return 0;
 }
 
-- 
CYa,
  ⡍⠁⠗⠊⠕

Reply to: