summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-03-16 14:27:49 -0600
committerKarl Williamson <khw@cpan.org>2020-03-16 20:42:18 -0600
commit3e66cf746848e9cdd3d001d1261e869c33ab2651 (patch)
tree3d7d33c3ef4b962ebc5c12f552751068ac656bbe /util.c
parente1c8059fb886c7bbbdf9626cb16453477a1b50eb (diff)
downloadperl-3e66cf746848e9cdd3d001d1261e869c33ab2651.tar.gz
perlre: Note savepv() allocations need to be freed
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.c b/util.c
index 21625ad9b9..8ea945b760 100644
--- a/util.c
+++ b/util.c
@@ -1065,8 +1065,10 @@ Perl_cntrl_to_mnemonic(const U8 c)
Perl's version of C<strdup()>. Returns a pointer to a newly allocated
string which is a duplicate of C<pv>. The size of the string is
determined by C<strlen()>, which means it may not contain embedded C<NUL>
-characters and must have a trailing C<NUL>. The memory allocated for the new
-string can be freed with the C<Safefree()> function.
+characters and must have a trailing C<NUL>. To prevent memory leaks, the
+memory allocated for the new string needs to be freed when no longer needed.
+This can be done with the L</C<Safefree> function, or
+L<C<SAFEFREEPV>perlguts/SAFEFREEPV>.
On some platforms, Windows for example, all allocated memory owned by a thread
is deallocated when that thread ends. So if you need that not to happen, you