]> granicus.if.org Git - php/commitdiff
Missing bit of the previous patch.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 25 Jun 2003 18:06:56 +0000 (18:06 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 25 Jun 2003 18:06:56 +0000 (18:06 +0000)
ext/sqlite/sqlite.c

index fea0e8e6ca81772ca5335e996887225198e7be30..09cd4f63bdaefda50e043310e5c2d82a5dfa895c 100644 (file)
@@ -1323,8 +1323,10 @@ static void php_sqlite_fetch_string(struct php_sqlite_result *res, zend_bool dec
        if (decode_binary && rowdata[0] != NULL && rowdata[0][0] == '\x01') {
                decoded = emalloc(strlen(rowdata[0]));
                decoded_len = sqlite_decode_binary(rowdata[0]+1, decoded);
-               efree((char*)rowdata[0]);
-               rowdata[0] = NULL;
+               if (!res->buffered) {
+                       efree((char*)rowdata[0]);
+                       rowdata[0] = NULL;
+               }
        } else if (rowdata[0]) {
                decoded_len = strlen((char*)rowdata[0]);
                if (res->buffered) {