After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309130 - Memory leak and uninitialized memory usage in backup conduit
Memory leak and uninitialized memory usage in backup conduit
Status: RESOLVED FIXED
Product: gnome-pilot
Classification: Other
Component: conduit: backup
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: Matt Davey
gnome-pilot Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-27 14:05 UTC by Mark Adams
Modified: 2006-04-20 21:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix memory leak and UMR in backup conduit (1.54 KB, patch)
2005-06-27 14:07 UTC, Mark Adams
needs-work Details | Review

Description Mark Adams 2005-06-27 14:05:16 UTC
Version details: 2.0.13
Distribution/Version: Fedora Core 4

While working on fixing bug #274032 I ran into a memory leak and a uninitialized
memory usage in the backup conduit while running gpilotd under valgrind. The
following patch fixes those two issues, and is against gnome-pilot-2.0.13
Comment 1 Mark Adams 2005-06-27 14:07:29 UTC
Created attachment 48413 [details] [review]
Fix memory leak and UMR in backup conduit
Comment 2 JP Rosevear 2005-08-10 14:55:46 UTC
The exit_and_free label is really useless, the only spot its used is when f is
NULL anyhow.  Additionally we don't send an error in any case except if closing
the file fails.  I think the error handling should be restructured to fall
through more gracefully and send an error in more error cases.
Comment 3 Matt Davey 2006-04-19 10:46:13 UTC
Interestingly, the submitted patch, included in the fc5 updated RPM (downgrading to pl 0.11.8) causes a crasher in pi_file_close, as it's being caused with null... On 0.12 pi_file_close tolerates a null argument.

I hadn't noticed that this patch hadn't been incorporated.  I'll take a look.
Comment 4 Matt Davey 2006-04-20 21:30:00 UTC
I've committed a patch incorporating most of the contributed patch.
Includes a fix for a typo dating from 2001 that read uninitialised memory.  Yuck.

Many thanks for the patch.