summaryrefslogtreecommitdiffstats
path: root/src/io/streamtest.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2011-07-20 18:31:22 +0000
committerKris <Kris.De.Gussem@hotmail.com>2011-07-20 18:31:22 +0000
commit527379af505ab25b77033407d0ab8f6dff6a59e4 (patch)
tree61526e5ca543b47760dbe11c3266281454006063 /src/io/streamtest.cpp
parentFilters. Custom predefined filters update. (diff)
downloadinkscape-527379af505ab25b77033407d0ab8f6dff6a59e4.tar.gz
inkscape-527379af505ab25b77033407d0ab8f6dff6a59e4.zip
Memory leak fixes (Bug #812497)
(bzr r10483)
Diffstat (limited to 'src/io/streamtest.cpp')
-rw-r--r--src/io/streamtest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/io/streamtest.cpp b/src/io/streamtest.cpp
index b25ef43f0..2030e6a85 100644
--- a/src/io/streamtest.cpp
+++ b/src/io/streamtest.cpp
@@ -219,13 +219,15 @@ int main(int argc, char **argv)
// create temp files somewhere else instead of current dir
// TODO: clean them up too
char * testpath = strdup("/tmp/streamtest-XXXXXX");
- testpath = mkdtemp(testpath);
- if (!testpath)
+ char * testpath2;
+ testpath2 = mkdtemp(testpath);
+ free(testpath);
+ if (!testpath2)
{
perror("mkdtemp");
return 1;
}
- if (chdir(testpath))
+ if (chdir(testpath2))
{
perror("chdir");
return 1;