Commit 995bb81
replace: add NULL checks for memdupzero/memdupdec return values
Both memdupzero() and memdupdec() can return NULL on allocation
failure. The call site in replace() dereferenced them unconditionally,
which would crash on out-of-memory. Add NULL checks and call errorf()
on failure, consistent with the rest of the codebase.1 parent ed30ae6 commit 995bb81
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1662 | 1662 | | |
1663 | 1663 | | |
1664 | 1664 | | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1665 | 1670 | | |
1666 | 1671 | | |
1667 | 1672 | | |
| |||
0 commit comments