slackware-current/source/l/strigi/libstreams-0002-Reduce-noise-in-analysis-tools-complain-about-resour.patch

66 lines
2.2 KiB
Diff
Raw Normal View History

From 314f9d8f4fc50323e9f670ef54f0263cec08abc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=96mer=20Fad=C4=B1l=20USTA?= <omerusta@gmail.com>
Date: Tue, 9 Apr 2013 04:01:23 +0300
Subject: [PATCH 2/5] Reduce noise in analysis tools complain about resource
leak
Cppcheck gives false alerts. This will stop it complaining about
resource leakage.
Thanks to mpyne for review of patch
REVIEW: 109920
---
lib/fileinputstream.cpp | 4 ++--
lib/skippingfileinputstream.cpp | 4 ++--
lib/skippingfileinputstream2.cpp | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/fileinputstream.cpp b/lib/fileinputstream.cpp
index 2801d1b..820b831 100644
--- a/lib/fileinputstream.cpp
+++ b/lib/fileinputstream.cpp
@@ -39,8 +39,8 @@ FileInputStream::FileInputStream(const char* filepath, int32_t buffersize) {
m_status = Error;
return;
}
- FILE* f = fopen(filepath, "rb");
- open(f, filepath, buffersize);
+ file = fopen(filepath, "rb");
+ open(file, filepath, buffersize);
}
FileInputStream::FileInputStream(FILE* file, const char* filepath,
int32_t buffersize) {
diff --git a/lib/skippingfileinputstream.cpp b/lib/skippingfileinputstream.cpp
index dcb4d32..9759c54 100644
--- a/lib/skippingfileinputstream.cpp
+++ b/lib/skippingfileinputstream.cpp
@@ -38,8 +38,8 @@ SkippingFileInputStream::SkippingFileInputStream(const char* filepath) {
m_status = Error;
return;
}
- FILE* f = fopen(filepath, "rb");
- open(f, filepath);
+ file = fopen(filepath, "rb");
+ open(file, filepath);
}
void
SkippingFileInputStream::open(FILE* f, const char* path) {
diff --git a/lib/skippingfileinputstream2.cpp b/lib/skippingfileinputstream2.cpp
index dc618f4..dcfcef2 100644
--- a/lib/skippingfileinputstream2.cpp
+++ b/lib/skippingfileinputstream2.cpp
@@ -36,8 +36,8 @@ SkippingFileInputStream2::SkippingFileInputStream2(const char* filepath, int32_t
m_status = Error;
return;
}
- FILE* f = fopen(filepath, "rb");
- open(f, filepath, buffersize);
+ file = fopen(filepath, "rb");
+ open(file, filepath, buffersize);
}
SkippingFileInputStream2::SkippingFileInputStream2(FILE* file, const char* filepath,
int32_t buffersize) {
--
1.8.4.2