summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-10-01 22:19:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-10-02 23:19:51 +0100
commitd820977d6aedc8447d50862751adb61cadf488c9 (patch)
tree03acb9b9145b57b5d42681200686fe5319511661 /hwpfilter
parentb48e2d958c905322ebd3219cc2141c7c2f0ce768 (diff)
valgrind: fix leak
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpfile.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index b77cc1dad25f..66e0eb903ef5 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -70,16 +70,10 @@ HWPFile::HWPFile()
SetCurrentDoc(this);
}
-/**
- * TODO : Ãß°¡µÈ ½ºÅ¸Àϸ®½ºÆ®¿¡ ´ëÇÑ ¸Þ¸ð¸® ÇØÁ¦
- */
HWPFile::~HWPFile()
{
- if (oledata)
- delete oledata;
-
- if (hiodev)
- delete hiodev;
+ delete oledata;
+ delete hiodev;
LinkedListIterator < ColumnInfo > it_column(&columnlist);
for (; it_column.current(); it_column++)
@@ -129,20 +123,17 @@ int detect_hwp_version(const char *str)
int HWPFile::Open(HStream & stream)
{
- HStreamIODev *hstreamio;
+ HStreamIODev *hstreamio = new HStreamIODev(stream);
- if (0 == (hstreamio = new HStreamIODev(stream)))
- {
- printf(" hstreamio is not instanciate \n");
- return SetState(errno);
- }
if (!hstreamio->open())
{
delete hstreamio;
return SetState(HWP_EMPTY_FILE);
}
- SetIODevice(hstreamio);
+
+ HIODev *pPrev = SetIODevice(hstreamio);
+ delete pPrev;
char idstr[HWPIDLen];
@@ -227,6 +218,7 @@ HIODev *HWPFile::SetIODevice(HIODev * new_hiodev)
HIODev *old_hiodev = hiodev;
hiodev = new_hiodev;
+
return old_hiodev;
}