[88467] trunk/dports/devel/caml-ancient

mww at macports.org mww at macports.org
Tue Jan 3 01:46:30 PST 2012


Revision: 88467
          http://trac.macports.org/changeset/88467
Author:   mww at macports.org
Date:     2012-01-03 01:46:28 -0800 (Tue, 03 Jan 2012)
Log Message:
-----------
devel/caml-ancient: Fix error path if realloc call fails (upstream); inc revision

Modified Paths:
--------------
    trunk/dports/devel/caml-ancient/Portfile

Added Paths:
-----------
    trunk/dports/devel/caml-ancient/files/
    trunk/dports/devel/caml-ancient/files/patch-ancient_c.c.diff

Modified: trunk/dports/devel/caml-ancient/Portfile
===================================================================
--- trunk/dports/devel/caml-ancient/Portfile	2012-01-03 09:31:55 UTC (rev 88466)
+++ trunk/dports/devel/caml-ancient/Portfile	2012-01-03 09:46:28 UTC (rev 88467)
@@ -3,6 +3,7 @@
 PortSystem          1.0
 name                caml-ancient
 version             0.9.0
+revision            1
 categories          devel ml
 maintainers         mww openmaintainer
 license             LGPL-2.1
@@ -17,6 +18,7 @@
 checksums           md5     a5529e09f3c96247f362b7640e710157 \
                     sha1    be60cddcc3047cd34fa452d816d5ab13edd6ea54 \
                     rmd160  96c3ef4f3c6d8f303ebbc3bc60ae336db23a3fb2
+patchfiles          patch-ancient_c.c.diff
 
 depends_lib         port:ocaml port:caml-findlib
 

Added: trunk/dports/devel/caml-ancient/files/patch-ancient_c.c.diff
===================================================================
--- trunk/dports/devel/caml-ancient/files/patch-ancient_c.c.diff	                        (rev 0)
+++ trunk/dports/devel/caml-ancient/files/patch-ancient_c.c.diff	2012-01-03 09:46:28 UTC (rev 88467)
@@ -0,0 +1,20 @@
+--- ancient_c.c
++++ ancient_c.c
+@@ -133,13 +133,15 @@ area_init_custom (area *a,
+ static inline int
+ area_append (area *a, const void *obj, size_t size)
+ {
++  void *ptr;
+   while (a->n + size > a->size) {
+     if (a->size == 0) a->size = 256; else a->size <<= 1;
+-    a->ptr =
++    ptr =
+       a->realloc
+       ? a->realloc (a->data, a->ptr, a->size)
+       : realloc (a->ptr, a->size);
+-    if (a->ptr == 0) return -1; // Out of memory.
++    if (ptr == 0) return -1; // Out of memory.
++    a->ptr = ptr;
+   }
+   memcpy (a->ptr + a->n, obj, size);
+   a->n += size;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120103/206034ca/attachment.html>


More information about the macports-changes mailing list