Permalink
Browse files

fixed a memory leak

  • Loading branch information...
vegardb committed Feb 17, 2012
1 parent 463f625 commit 8efb71d1d39a9e5da8868d117a1b098f5225541b
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/blob/database_query.c
@@ -45,12 +45,10 @@ static char * performSimpleQuery_(const char * query)
SPI_connect();
int result = SPI_exec(query, 1);
- ret = strdup(SPI_getvalue(* SPI_tuptable->vals, SPI_tuptable->tupdesc, 1));
+ if ( result >= 0 )
+ ret = strdup(SPI_getvalue(* SPI_tuptable->vals, SPI_tuptable->tupdesc, 1));
SPI_finish();
- if ( result < 0 )
- return NULL;
-
return ret;
}

0 comments on commit 8efb71d

Please sign in to comment.