Wow, cut me off!
Here is the warning:
(error) Common realloc mistake: "ptr" nulled but not freed upon failure
Unfortunately, the patch I sent was somehow incorrect. I am really not sure
how I managed that as my local copy seems correct. Anyway, thanks for not
letting me introduce a bug.
Attached is the corrected patch.
On 29 September 2010 13:32, Kohei Yoshida <kyoshida@novell.com> wrote:
On Wed, 2010-09-29 at 21:02 +0100, Michael Meeks wrote:
Attached is a small patch that does nothing except eliminate one
cppcheck warning. It is contributed under the LGPL3+.
What is the warning ? :-)
I can give you that info as I was also curious about this:
$ cppcheck soltools/javadep/javadep.c
Checking soltools/javadep/javadep.c...
[soltools/javadep/javadep.c:606]: (error) Common realloc mistake: "ptr"
nulled but not freed upon failure
Checking soltools/javadep/javadep.c: DEBUG...
Checking soltools/javadep/javadep.c: OS2...
Checking soltools/javadep/javadep.c: WNT...
--
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>
diff --git a/soltools/javadep/javadep.c b/soltools/javadep/javadep.c
index d6dc580..4f8877b 100644
--- a/soltools/javadep/javadep.c
+++ b/soltools/javadep/javadep.c
@@ -603,9 +603,11 @@ xcalloc(size_t nmemb, size_t size)
void *
xrealloc(void *ptr, size_t size)
{
- ptr = realloc(ptr, size);
+ void *newptr = realloc(ptr, size);
- if ( !ptr )
+ if (newptr)
+ ptr = newptr;
+ else
err_quit("out of memory");
return ptr;
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.