This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fixup Perl_magic_freemglob()
authorDavid Mitchell <davem@iabyn.com>
Mon, 22 Feb 2021 10:00:27 +0000 (10:00 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 22 Feb 2021 10:00:27 +0000 (10:00 +0000)
commit5d273abb14ecf2af8a75115442c938b8a5979ebe
tree8b77d07fbea7e7985d7a03942d96a929454f8659
parentb3a019b423725caa4eb6a8615a6c1367b85326b0
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.
mg.c