summaryrefslogtreecommitdiffstats
path: root/hwpfilter
diff options
context:
space:
mode:
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hinfo.cxx6
-rw-r--r--hwpfilter/source/hinfo.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 2e5d4b1c9a16..3d262b5c7d1e 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -66,8 +66,6 @@ HWPInfo::HWPInfo()
HWPInfo::~HWPInfo()
{
- delete[] info_block;
- info_block = nullptr;
}
@@ -163,9 +161,9 @@ void HWPInfo::Read(HWPFile & hwpf)
return;
if (info_block_len > 0)
{
- info_block = new unsigned char[info_block_len + 1];
+ info_block.reset( new unsigned char[info_block_len + 1] );
- if (!HWPReadInfoBlock(info_block, info_block_len, hwpf))
+ if (!HWPReadInfoBlock(info_block.get(), info_block_len, hwpf))
return;
}
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index 7f1eee0657c7..a381cc1dfb59 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -24,6 +24,7 @@
#include "string.h"
#include <vector>
+#include <memory>
#define CHAIN_MAX_PATH 40
#define ANNOTATION_LEN 24
@@ -201,7 +202,7 @@ class DLLEXPORT HWPInfo
* Summary of document
*/
HWPSummary summary;
- unsigned char *info_block;
+ std::unique_ptr<unsigned char[]> info_block;
HWPInfo(void);
~HWPInfo(void);