From a1b2df31d6d7c2e724d2190e1ec0f5b728211529 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 17 Jan 2011 14:07:40 +0000 Subject: - don't try to access if calloc fails (quick review of its usage: seems that the stats member is validated in other places, to be confirmed) --- ext/mysqlnd/mysqlnd_statistics.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/mysqlnd/mysqlnd_statistics.c') diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index 7745a244d5..3098a7cfa6 100644 --- a/ext/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c @@ -245,6 +245,10 @@ PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, size_t statistic_count) { *stats = calloc(1, sizeof(MYSQLND_STATS)); + if (*stats == NULL) { + DBG_ENTER("mysqlnd_stats_init failed to calloc stats context"); + return; + } (*stats)->values = calloc(statistic_count, sizeof(uint64_t)); (*stats)->triggers = calloc(statistic_count, sizeof(mysqlnd_stat_trigger)); (*stats)->in_trigger = FALSE; -- cgit v1.2.1