summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/collate.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-09-16 04:17:47 +0000
committerimp <imp@FreeBSD.org>1998-09-16 04:17:47 +0000
commitbfe73fd683053201c326f9ff2c8e5e0f69cc7fe7 (patch)
treeb17d45198953bfbbad4bfd632dfdf1a37b7159d2 /lib/libc/locale/collate.c
parent68a8c771724d4fc671cac3ce95f78d4fb1874cfe (diff)
downloadFreeBSD-src-bfe73fd683053201c326f9ff2c8e5e0f69cc7fe7.zip
FreeBSD-src-bfe73fd683053201c326f9ff2c8e5e0f69cc7fe7.tar.gz
Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
Diffstat (limited to 'lib/libc/locale/collate.c')
-rw-r--r--lib/libc/locale/collate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index d1f03e7..87b4058 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: collate.c,v 1.15 1997/02/22 14:59:52 peter Exp $
*/
#include <rune.h>
@@ -114,7 +114,7 @@ __collate_substitute(s)
if(!dest_str)
dest_str = calloc(dest_len = delta, 1);
else
- dest_str = realloc(dest_str, dest_len += delta);
+ dest_str = reallocf(dest_str, dest_len += delta);
if(dest_str == NULL)
__collate_err(EX_OSERR, __FUNCTION__);
}
OpenPOWER on IntegriCloud