]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidxshard: clear $msgref buffer properly
authorEric Wong <e@yhbt.net>
Sat, 22 Aug 2020 06:06:23 +0000 (06:06 +0000)
committerEric Wong <e@yhbt.net>
Sun, 23 Aug 2020 00:13:59 +0000 (00:13 +0000)
Merely assigning `undef' to a scalar does not free the
underlying buffer memory of a scalar.

lib/PublicInbox/SearchIdxShard.pm

index 20077e08fa2edc13ef17926d7bc55789559f628d..75521b43a4087badcc5daa2bccc5adcd9323956d 100644 (file)
@@ -97,7 +97,7 @@ sub index_raw {
                        "\n", $$msgref or die "failed to write shard $!\n";
        } else {
                if ($eml) {
-                       $$msgref = undef;
+                       undef $$msgref;
                } else { # --xapian-only + --sequential-shard:
                        $eml = PublicInbox::Eml->new($msgref);
                }