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

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

From:
iabyn via perl5-changes
Date:
February 22, 2021 10:30
Subject:
[Perl/perl5] 5d273a: fixup Perl_magic_freemglob()
Message ID:
Perl/perl5/push/refs/heads/blead/b3a019-5d273a@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5d273abb14ecf2af8a75115442c938b8a5979ebe
      https://github.com/Perl/perl5/commit/5d273abb14ecf2af8a75115442c938b8a5979ebe
  Author: David Mitchell <davem@iabyn.com>
  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.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About