Fix another memory leak in executor.
authorPavan Deolasee <[email protected]>
Thu, 14 Apr 2016 09:00:05 +0000 (14:30 +0530)
committerPavan Deolasee <[email protected]>
Tue, 18 Oct 2016 10:05:06 +0000 (15:35 +0530)
src/backend/access/common/heaptuple.c

index 5e25b5e09f4766aff6459b85f5ee6ef116fa84d5..b092f8c2e438aa309afaffaa578a7c59f6f325f1 100644 (file)
@@ -1325,6 +1325,10 @@ slot_deform_datarow(TupleTableSlot *slot)
                                }
                                data = MemoryContextAlloc(slot->tts_drowcxt, data_length);
                                memcpy(data, val, data_length);
+
+                               if (slot->tts_values[i])
+                                       pfree(slot->tts_values[i]);
+
                                slot->tts_values[i] = (Datum) data;
                        }
                }