The following patch saves a memory allocation when quoteFunc() is invoked on a blob:
{{{
Index: src/func.c
==================================================================
--- src/func.c
+++ src/func.c
@@ -1067,12 +1067,11 @@
}
zText[(nBlob*2)+2] = '\'';
zText[(nBlob*2)+3] = '\0';
zText[0] = 'X';
zText[1] = '\'';
- sqlite3_result_text(context, zText, -1, SQLITE_TRANSIENT);
- sqlite3_free(zText);
+ sqlite3_result_text(context, zText, (nBlob*2)+3, sqlite3_free);
}
break;
}
case SQLITE_TEXT: {
int i,j;
}}}