diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index 08c1b216aa2..b6157699af1 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -382,7 +382,8 @@ hstoreUniquePairs(Pairs *a, int32 l, int32 *buflen) if (ptr->needfree) { pfree(ptr->key); - pfree(ptr->val); + if (ptr->val != NULL) + pfree(ptr->val); } } else