Blame SOURCES/0015-osutils-Using-delete-instead-of-delete.patch

df7b7f
From 9bbce4d54c1d54b660ec04b18d507f20a2a31ccf Mon Sep 17 00:00:00 2001
df7b7f
From: Erwan Velu <erwan@redhat.com>
df7b7f
Date: Mon, 26 Sep 2016 22:18:12 +0200
df7b7f
Subject: [PATCH 15/43] osutils: Using delete[] instead of delete
df7b7f
df7b7f
When compiling lshw, we get a warning regarding the usage of delete.
df7b7f
df7b7f
    osutils.cc:425:3: warning: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'
df7b7f
df7b7f
This commit simply use the proper delete operator for this operation.
df7b7f
---
df7b7f
 src/core/osutils.cc | 2 +-
df7b7f
 1 file changed, 1 insertion(+), 1 deletion(-)
df7b7f
df7b7f
diff --git a/src/core/osutils.cc b/src/core/osutils.cc
df7b7f
index 95c8483..cc03dc4 100644
df7b7f
--- a/src/core/osutils.cc
df7b7f
+++ b/src/core/osutils.cc
df7b7f
@@ -422,7 +422,7 @@ string dirname(const string & path)
df7b7f
   path.copy(buffer, len);
df7b7f
   buffer[len] = '\0';
df7b7f
   string result = dirname(buffer);
df7b7f
-  delete buffer;
df7b7f
+  delete[] buffer;
df7b7f
   return result;
df7b7f
 }
df7b7f
 
df7b7f
-- 
df7b7f
2.10.2
df7b7f