From 559a45503f524e76fec5738e2ec2efd397772b12 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Wed, 16 Mar 2005 12:26:22 +0000 Subject: [PATCH] Ignore invalid queries --- src/query.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/query.c b/src/query.c index adba05f1..3d15230e 100644 --- a/src/query.c +++ b/src/query.c @@ -89,12 +89,13 @@ char *query_build_sql(char *query) { int size=sizeof(sql); pquery=query_build(query); - if(!query_build_clause(pquery,&sqlptr,&size)) { + if(pquery) { + if(!query_build_clause(pquery,&sqlptr,&size)) { + query_free(pquery); + return strdup(sql); + } query_free(pquery); - return strdup(sql); } - - query_free(pquery); return NULL; }