summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-10-01 15:51:13 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-01 15:51:13 +0100
commit0b4bcc5b83d01c1aed2564ad7be69ecd7a118a37 (patch)
treef28d6de6ff1b7d358cc63f3f64ebfd9b7c1cfea4
parent52e9c0434c77eccccd58410b5fdc4300654dff01 (diff)
calm down cppcheck patch
Thanks to: Justin Malcolm <malcolm.justin@gmail.com>
-rw-r--r--soltools/javadep/javadep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/soltools/javadep/javadep.c b/soltools/javadep/javadep.c
index d6dc580dd..6d4e74bb5 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;