diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index e358b5a..9250646 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -3728,6 +3728,7 @@ populate_recordset_worker(FunctionCallInfo fcinfo, const char *funcname,
 
 	rsi->setResult = state->tuple_store;
 	rsi->setDesc = cache->c.io.composite.tupdesc;
+	rsi->setDesc->tdrefcount = 1;
 
 	PG_RETURN_NULL();
 }
