diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-25 01:06:47 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-25 01:06:47 +0000 |
| commit | 4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3 (patch) | |
| tree | 75853d8eec5e85fb93a2a798b57f072e3c9eeb99 /src/io | |
| parent | Replace direct use of Cairo contexts and surfaces in the rendering tree (diff) | |
| parent | Revert workarounds from 10501 - no longer necessary (diff) | |
| download | inkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.tar.gz inkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.zip | |
Merge from trunk
(bzr r10347.1.18)
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/ftos.cpp | 2 | ||||
| -rw-r--r-- | src/io/inkjar.cpp | 19 | ||||
| -rw-r--r-- | src/io/streamtest.cpp | 8 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/io/ftos.cpp b/src/io/ftos.cpp index 47f0dc232..b8d161ca4 100644 --- a/src/io/ftos.cpp +++ b/src/io/ftos.cpp @@ -320,6 +320,7 @@ string ftos(double val, char mode, int sigfig, int precision, int options) break; default: + g_free(p); return "**bad mode**"; } @@ -413,6 +414,7 @@ string ftos(double val, char mode, int sigfig, int precision, int options) fprintf(stderr, "*** End of ftos with ascii = ", ascii.c_str()); #endif /* finally, we can return */ + g_free(p); return ascii; } diff --git a/src/io/inkjar.cpp b/src/io/inkjar.cpp index c238aba36..20b164b99 100644 --- a/src/io/inkjar.cpp +++ b/src/io/inkjar.cpp @@ -139,16 +139,18 @@ bool JarFile::read_signature() #endif if (signature == 0x08074b50) { - //skip data descriptor - bytes = (guint8 *)malloc(sizeof(guint8) * 12); - if (!read(bytes, 12)) { - g_free(bytes); - return false; - } + //skip data descriptor + bytes = (guint8 *)g_malloc(sizeof(guint8) * 12); + if (!read(bytes, 12)) { + g_free(bytes); + return false; + } else { + g_free(bytes); + } } else if (signature == 0x02014b50 || signature == 0x04034b50) { - return true; + return true; } else { - return false; + return false; } return false; } @@ -214,6 +216,7 @@ GByteArray *JarFile::get_next_file_contents() if (_last_filename != NULL) g_free(_last_filename); _last_filename = NULL; + g_free(bytes); return NULL; } 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; |
