bug-gnu-utils
[Top][All Lists]
Advanced

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

[PATCH] avoid malloc(0) for AIX


From: Fabian Groffen
Subject: [PATCH] avoid malloc(0) for AIX
Date: Mon, 24 Oct 2011 20:11:44 +0200
User-agent: Mutt/1.5.21 (Darwin 11.2.0, VIM - Vi IMproved 7.3)

On AIX, malloc(0) segfaults, hence avoid calling malloc(0).

--- sed-4.2.1/lib/regex_internal.c
+++ sed-4.2.1/lib/regex_internal.c
@@ -883,6 +883,9 @@
      re_node_set *set;
      int size;
 {
+  if ( size == 0 )
+    return REG_NOERROR;
+
   set->alloc = size;
   set->nelem = 0;
   set->elems = re_malloc (int, size);

-- 
Fabian Groffen
Gentoo on a different level

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]