Skip to content

Commit

Permalink
Plug a trivial memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
did-g authored and JLockerman committed Dec 5, 2018
1 parent 701e921 commit 62571e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extension_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extension_version(void)
HeapTuple tuple;
ScanKeyData entry[1];
bool is_null = true;
static char *sql_version = NULL;
char *sql_version = NULL;

rel = heap_open(ExtensionRelationId, AccessShareLock);

Expand All @@ -95,7 +95,7 @@ extension_version(void)

if (!is_null)
{
sql_version = strdup(TextDatumGetCString(result));
sql_version = pstrdup(TextDatumGetCString(result));
}
}

Expand Down

0 comments on commit 62571e2

Please sign in to comment.