]> granicus.if.org Git - php/commitdiff
- don't try to access if calloc fails (quick review of its usage: seems that the...
authorPierre Joye <pajoye@php.net>
Mon, 17 Jan 2011 14:07:40 +0000 (14:07 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 17 Jan 2011 14:07:40 +0000 (14:07 +0000)
ext/mysqlnd/mysqlnd_statistics.c

index 7745a244d5e63849c14fa505fd48d482f5d46db5..3098a7cfa637663ad5f8577a1712c3e2da90ea74 100644 (file)
@@ -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;