Skip to content

Commit

Permalink
remove misplaced pfree (#509)
Browse files Browse the repository at this point in the history
We missed removing a pfree during cherry pick from community
which resulted in invalid write since we ended up writing on freed
data inside NextCopyFrom() here
```
MemSet(cstate->defaults, false, num_phys_attrs * sizeof(bool));
```

[babelfish cherry pick commit](16f3f16#diff-5974661d4ffb034fd936898b834cfd5c28e5ada5ea84b8863a32355af35c4f5bR1612) vs [community commit](postgres/postgres@b635ac0#diff-98d8bfd706468f77f8b0d5d0797e3dba3ffaaa88438143ef4cf7fedecaa56827L1043)

With this fix, problematic test file runs clean with valgrind

Task: [BABEL-5501]

Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 authored Dec 30, 2024
1 parent 408ce0b commit 181161a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/backend/commands/copyfromparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,6 @@ NextCopyFrom(CopyFromState cstate, ExprContext *econtext,
if (fill_missing_values_in_copyfrom_hook)
fill_missing_values_in_copyfrom_hook(cstate->rel, values, nulls);

pfree(cstate->defaults);

return true;
}

Expand Down

0 comments on commit 181161a

Please sign in to comment.