summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_statistics.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqlnd/mysqlnd_statistics.c')
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c
index a203fdac07..174ca682d7 100644
--- a/ext/mysqlnd/mysqlnd_statistics.c
+++ b/ext/mysqlnd/mysqlnd_statistics.c
@@ -247,6 +247,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;