[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] Memory leaks
From: |
Aleksander Morgado |
Subject: |
[pdf-devel] Memory leaks |
Date: |
Wed, 23 Apr 2008 13:25:41 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (Macintosh/20080213) |
Hi all,
I found a couple of memory leaks when running the unit tests. Two of
them are coming from the library (hash module and stm module) and the
rest of them are coming from the unit tests (not deallocating iterators
mainly). There were more in the text module, but I already commited the
corresponding bugfixes.
There are also a couple of errors affecting the stm module, when
comparing the expected return of a function, but I guess they are not
important right now as the stm module will be modified to run with the
filesystem module. BTW, the stm unit test suite was deactivated in
runtests.c until the new stm module is finished.
Find the patch attached for review.
Regards,
-Aleksander
Index: src/base/pdf-hash.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/src/base/pdf-hash.c,v
retrieving revision 1.2
diff -r1.2 pdf-hash.c
109a110
> pdf_dealloc((pdf_hash_element_t*)elt);
220c221
< pdf_hash_element_t elt, *removed;
---
> pdf_hash_element_t elt;
230a232,234
> pdf_hash_element_t *removed;
> removed = (pdf_hash_element_t*)
> gl_list_node_value((gl_list_t)table.elements, node);
233,234d236
< removed = (pdf_hash_element_t*)
< gl_list_node_value((gl_list_t)table.elements, node);
236a239
> pdf_dealloc(removed);
Index: src/base/pdf-stm-file.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/src/base/pdf-stm-file.c,v
retrieving revision 1.4
diff -r1.4 pdf-stm-file.c
94a95
> pdf_dealloc((*data)->filename);
Index: src/base/pdf-stm.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/src/base/pdf-stm.c,v
retrieving revision 1.8
diff -r1.8 pdf-stm.c
107c107
< if (!((new_stm->backend.funcs.init) (&new_stm->backend.data, &conf)))
---
> if (((new_stm->backend.funcs.init) (&new_stm->backend.data, &conf)) !=
> PDF_OK)
Index: torture/unit/base/hash/pdf-hash-iterator-next.c
===================================================================
RCS file:
/cvsroot/pdf/libgnupdf/torture/unit/base/hash/pdf-hash-iterator-next.c,v
retrieving revision 1.2
diff -r1.2 pdf-hash-iterator-next.c
53a54
> pdf_hash_iterator_free(&itr);
99a101
> pdf_hash_iterator_free(&itr);
Index: torture/unit/base/hash/pdf-hash-iterator.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/torture/unit/base/hash/pdf-hash-iterator.c,v
retrieving revision 1.1
diff -r1.1 pdf-hash-iterator.c
49a50
> pdf_hash_iterator_free(&itr);
Index: torture/unit/base/list/pdf-list-iterator-from-to.c
===================================================================
RCS file:
/cvsroot/pdf/libgnupdf/torture/unit/base/list/pdf-list-iterator-from-to.c,v
retrieving revision 1.3
diff -r1.3 pdf-list-iterator-from-to.c
55a56
> pdf_list_iterator_free(&itr);
Index: torture/unit/base/list/pdf-list-iterator-next.c
===================================================================
RCS file:
/cvsroot/pdf/libgnupdf/torture/unit/base/list/pdf-list-iterator-next.c,v
retrieving revision 1.3
diff -r1.3 pdf-list-iterator-next.c
56a57
> pdf_list_iterator_free(&itr);
82a84
> pdf_list_iterator_free(&itr);
Index: torture/unit/base/list/pdf-list-iterator.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/torture/unit/base/list/pdf-list-iterator.c,v
retrieving revision 1.1
diff -r1.1 pdf-list-iterator.c
50a51
> pdf_list_iterator_free(&itr);
Index: torture/unit/base/stm/pdf-create-file-stm.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/torture/unit/base/stm/pdf-create-file-stm.c,v
retrieving revision 1.1
diff -r1.1 pdf-create-file-stm.c
87c87
< fail_if (!pdf_stm_close (stm));
---
> fail_if (pdf_stm_close (stm) != PDF_OK);
108c108
< fail_if (!pdf_stm_close (stm));
---
> fail_if (pdf_stm_close (stm) != PDF_OK);
- [pdf-devel] Memory leaks,
Aleksander Morgado <=