Commit ff6d9cf
committed
Fix some inconsistencies with memory freeing in pg_createsubscriber
The correct function documented to free the memory allocated for the
result returned by PQescapeIdentifier() and PQescapeLiteral() is
PQfreemem(). pg_createsubscriber.c relied on pg_free() instead, which
is not incorrect as both do a free() internally, but inconsistent with
the documentation.
While on it, this commit fixes a small memory leak introduced by
4867f8a, as the code of pg_createsubscriber makes this effort.
Author: Ranier Vilela
Reviewed-by: Euler Taveira
Discussion: https://postgr.es/m/CAEudQAp=AW5dJXrGLbC_aZg_9nOo=42W7uLDRONFQE-gcgnkgQ@mail.gmail.com
Backpatch-through: 171 parent fa761d9 commit ff6d9cf
1 file changed
+13
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
| 1134 | + | |
1134 | 1135 | | |
1135 | 1136 | | |
1136 | 1137 | | |
| |||
1330 | 1331 | | |
1331 | 1332 | | |
1332 | 1333 | | |
1333 | | - | |
| 1334 | + | |
1334 | 1335 | | |
1335 | 1336 | | |
1336 | 1337 | | |
| |||
1376 | 1377 | | |
1377 | 1378 | | |
1378 | 1379 | | |
1379 | | - | |
| 1380 | + | |
1380 | 1381 | | |
1381 | 1382 | | |
1382 | 1383 | | |
| |||
1615 | 1616 | | |
1616 | 1617 | | |
1617 | 1618 | | |
1618 | | - | |
1619 | | - | |
| 1619 | + | |
| 1620 | + | |
1620 | 1621 | | |
1621 | 1622 | | |
1622 | 1623 | | |
| |||
1639 | 1640 | | |
1640 | 1641 | | |
1641 | 1642 | | |
1642 | | - | |
| 1643 | + | |
1643 | 1644 | | |
1644 | 1645 | | |
1645 | 1646 | | |
| |||
1703 | 1704 | | |
1704 | 1705 | | |
1705 | 1706 | | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | 1713 | | |
| |||
1813 | 1814 | | |
1814 | 1815 | | |
1815 | 1816 | | |
1816 | | - | |
1817 | | - | |
| 1817 | + | |
| 1818 | + | |
1818 | 1819 | | |
1819 | 1820 | | |
1820 | 1821 | | |
| |||
1857 | 1858 | | |
1858 | 1859 | | |
1859 | 1860 | | |
1860 | | - | |
| 1861 | + | |
1861 | 1862 | | |
1862 | 1863 | | |
1863 | 1864 | | |
| |||
0 commit comments