fix query cleanup in dbuResultAsValue functions

Sun, 16 Feb 2025 17:38:07 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 16 Feb 2025 17:38:07 +0100
changeset 15
862ab606ee06
parent 14
59e62e65182c
child 16
04c9f8d8f03b

fix query cleanup in dbuResultAsValue functions

dbutils/db.c file | annotate | diff | comparison | revisions
--- a/dbutils/db.c	Sun Feb 16 15:50:04 2025 +0100
+++ b/dbutils/db.c	Sun Feb 16 17:38:07 2025 +0100
@@ -108,11 +108,14 @@
                 *result = r->optional_getInt(r, 0);
             } else {
                 cxstring s = r->getText(r, 0);
+                r->free(r);
                 return cx_strtoi64(s, result, 10);
             }
+            r->free(r);
             return 0;
         }
     }
+    r->free(r);
     return -1;
 }
 
@@ -140,9 +143,11 @@
             cxstring s = r->getText(r, 0);
             if(s.ptr) {
                 *result = cx_strdup(s);
+                r->free(r);
                 return 0;
             }
         }
     }
+    r->free(r);
     return -1;
 }

mercurial