[libgsf] try a leak fix.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] try a leak fix.
- Date: Fri, 17 Dec 2010 15:18:42 +0000 (UTC)
commit be1a1ded3007248280707532d9eb3b340a3678a3
Author: Morten Welinder <terra gnome org>
Date: Fri Dec 17 10:18:30 2010 -0500
try a leak fix.
ChangeLog | 4 ++++
tests/test-outmem-printf.c | 18 ++++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 72773ed..1a0c5c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-12-17 Morten Welinder <terra gnome org>
+
+ * tests/test-outmem-printf.c (test): Attempt a leak fix.
+
2010-11-10 Morten Welinder <terra gnome org>
* gsf/gsf-msole-utils.c (msole_prop_parse): Handle NULL error
diff --git a/tests/test-outmem-printf.c b/tests/test-outmem-printf.c
index df5e083..2eb755e 100644
--- a/tests/test-outmem-printf.c
+++ b/tests/test-outmem-printf.c
@@ -63,19 +63,25 @@ test (int argc, char *argv[])
output = gsf_output_memory_new ();
for (i = 1; i <= 100; i++) {
- if (!gsf_output_printf (output, "=== Round %d ===\n", i))
- return 1;
- if (!test_write_once (output))
- return 1;
+ if (!gsf_output_printf (output, "=== Round %d ===\n", i)) {
+ res = 1;
+ goto out;
+ }
+ if (!test_write_once (output)) {
+ res = 1;
+ goto out;
+ }
}
buf = gsf_output_memory_get_bytes (GSF_OUTPUT_MEMORY (output));
size = gsf_output_size (output);
- res = fwrite (buf, size, 1, fout);
+ res = fwrite (buf, size, 1, fout) == 1 ? 0 : 1;
+
+ out:
fclose (fout);
gsf_output_close (output);
g_object_unref (output);
- return (res == 1);
+ return res;
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]