diff options
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r-- | ext/sqlite/sqlite.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 4aa390fc78..07d3e60cbb 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -218,15 +218,14 @@ static void real_result_dtor(struct php_sqlite_result *res TSRMLS_DC) if (res->table) { if (!res->buffered && res->nrows) { res->nrows = 1; /* only one row is stored */ - } - for (i = 0; i < res->nrows; i++) { - base = i * res->ncolumns; - for (j = 0; j < res->ncolumns; j++) { - if (res->table[base + j] != NULL) { - efree(res->table[base + j]); + for (i = 0; i < res->nrows; i++) { + base = i * res->ncolumns; + for (j = 0; j < res->ncolumns; j++) { + if (res->table[base + j] != NULL) { + efree(res->table[base + j]); + } } } - } efree(res->table); } if (res->col_names) { |