summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2015-08-01 01:59:00 +0200
committerDylan William Hardison <dylan@hardison.net>2015-08-01 01:59:00 +0200
commitd7208303b8e0d025490f338241b2abb24dc5f1f4 (patch)
treec8fa6c3ff0da1e03144b47bd7b850c91de8f9297
parent3cd9430a0de3f9a4c066688ef6972b323aff6bea (diff)
downloadbugzilla-d7208303b8e0d025490f338241b2abb24dc5f1f4.tar.gz
bugzilla-d7208303b8e0d025490f338241b2abb24dc5f1f4.tar.xz
Bug 1189362 - Fix memory leak in Bugzilla::Bug->comments
-rw-r--r--Bugzilla/Bug.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 256784022..389747011 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -57,7 +57,7 @@ use List::Util qw(min max first);
use Storable qw(dclone);
use URI;
use URI::QueryParam;
-use Scalar::Util qw(blessed);
+use Scalar::Util qw(blessed weaken);
use base qw(Bugzilla::Object Exporter);
@Bugzilla::Bug::EXPORT = qw(
@@ -3628,6 +3628,7 @@ sub comments {
foreach my $comment (@{ $self->{'comments'} }) {
$comment->{count} = $count++;
$comment->{bug} = $self;
+ weaken($comment->{bug});
}
# Some bugs may have no comments when upgrading old installations.
Bugzilla::Comment->preload($self->{'comments'}) if @{ $self->{'comments'} };