develooper Front page | perl.perl5.changes | Postings from February 2021

[Perl/perl5] 5d273a: fixup Perl_magic_freemglob()

iabyn via perl5-changes
February 22, 2021 10:30
[Perl/perl5] 5d273a: fixup Perl_magic_freemglob()
Message ID:
  Branch: refs/heads/blead
  Commit: 5d273abb14ecf2af8a75115442c938b8a5979ebe
  Author: David Mitchell <>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M mg.c

  Log Message:
  fixup Perl_magic_freemglob()

In v5.33.3-24-g02a48966c3 I added the Perl_magic_freemglob() function,
which allowed special-case handling of the pos() magic type to be
removed from S_mg_free_struct().

However, I got it wrong, by more or less copying the same code from
another such function I had just created. So I made
Perl_magic_freemglob() free mg_ptr(), but in the case of pos magic, this
doesn't point to a buffer which needs freeing. In fact its currently
always NULL so attempting to free it is harmless - but this commit
removes the free() for logical soundness and future robustness. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About