Patch for cppcheck error "Common realloc mistake"



Hello,

I had sent a simple proposed patch 21/08 (http://old.nabble.com/Patch-for-cppcheck-error-%22Common-realloc-mistake%22-to32305733.html)

Since I didn't get answers and I received an email about gimp-dev mailing list available, I wanted to propose this very simple patch again :

diff --git a/libgimpbase/gimpreloc.c b/libgimpbase/gimpreloc.c
index 7461bed..238797f 100644
--- a/libgimpbase/gimpreloc.c
+++ b/libgimpbase/gimpreloc.c
@@ -245,7 +245,7 @@ _br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error)
                  * then transform that into a pointer. */
                 if (address_string_len < len + 3) {
                         address_string_len = len + 3;
- address_string = (char *) g_try_realloc (address_string, address_string_len); + address_string = (char *) g_realloc (address_string, address_string_len);
                 }

                 memcpy (address_string, "0x", 2);

Julien.

PS : is there a Nabble interface for this mailing-list ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]