GNOME Bugzilla – Bug 539396
Free of potentially uninitialized pointer, also blocked build for me
Last modified: 2018-06-29 22:05:54 UTC
Please describe the problem: In qofsession.c qof_session_save initializes msg only after some conditions, some of which can cause execution to get to the leave section, in which it is freed if not NULL. Steps to reproduce: 1. Compile the file, get a warning. 2. I built directly from SVN (make), got a "warning treated as errors" therefore had to fix it to proceed. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 113154 [details] [review] Proposed patch - initialize point to NULL at definition. Removed the warning, allowed me to complete compilation, and I think it should prevent possible bugs (though, not using the backend, I never saw an actual bug in the first place).
Thanks, Daniel. I wish I had seen your bug report earlier, as it would saved some time, but in the end this one got worked out independently on the gnucash-devel mailing list. This is now fixed as of r17248. Backport requested for 2.2.
*** This bug has been marked as a duplicate of 539829 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=539396. Please update any external references or bookmarks.