X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmbscasestr.c;h=ce28342c4978651ab0dfd8f1ff623104916e0dab;hb=4ad44dd748d5da39555cdf305568280d69a23354;hp=838120cbad0c7561d8bab1826a2590f6d46ee199;hpb=35aa104af1bc1bd8263bde7c4202406845403f83;p=gnulib.git diff --git a/lib/mbscasestr.c b/lib/mbscasestr.c index 838120cba..ce28342c4 100644 --- a/lib/mbscasestr.c +++ b/lib/mbscasestr.c @@ -25,6 +25,7 @@ #include #include /* for NULL, in case a nonstandard string.h lacks it */ +#include "allocsa.h" #if HAVE_MBRTOWC # include "mbuiter.h" #endif @@ -42,7 +43,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle, size_t m = strlen (needle); /* Allocate the table. */ - size_t *table = (size_t *) malloc (m * sizeof (size_t)); + size_t *table = (size_t *) allocsa (m * sizeof (size_t)); if (table == NULL) return false; /* Fill the table. @@ -117,7 +118,7 @@ knuth_morris_pratt_unibyte (const char *haystack, const char *needle, } } - free (table); + freesa (table); return true; } @@ -131,7 +132,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle, size_t *table; /* Allocate room for needle_mbchars and the table. */ - char *memory = (char *) malloc (m * (sizeof (mbchar_t) + sizeof (size_t))); + char *memory = (char *) allocsa (m * (sizeof (mbchar_t) + sizeof (size_t))); if (memory == NULL) return false; needle_mbchars = (mbchar_t *) memory; @@ -237,7 +238,7 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle, } } - free (memory); + freesa (memory); return true; } #endif