From 733d8409723a397b4ced39ea7aaab8bc8b4af5d9 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:30:29 -0500 Subject: opkg: adding the hash_table_remove API, not using yet. Just complete the API for future usage. Clean all the entry at initial time. This reduces planty of unnecessary check. In order to prevent this kind of bug, using calloc to replace most malloc git-svn-id: http://opkg.googlecode.com/svn/trunk@160 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/xregex.c') diff --git a/libopkg/xregex.c b/libopkg/xregex.c index 0ae54e7..b0cd8b9 100644 --- a/libopkg/xregex.c +++ b/libopkg/xregex.c @@ -39,7 +39,7 @@ static void print_regcomp_err(const regex_t *preg, int err) fprintf(stderr, "%s: Error compiling regex:", __FUNCTION__); size = regerror(err, preg, 0, 0); - error = malloc(size); + error = calloc(1, size); if (error) { regerror(err, preg, error, size); fprintf(stderr, "%s\n", error); -- cgit v0.9.1