summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Reddick <michael.reddick@gmail.com>2012-10-25 11:49:58 -0500
committerFranck Cuny <franck@lumberjaph.net>2012-11-25 11:37:18 -0800
commit26dccc1e8490375f89dae9a926a84ede69f12178 (patch)
tree77b2de0a16fd8e1672c0e869153292de8992381d
parentLet Dist::Zilla handle the version number. (diff)
downloadnet-http-spore-26dccc1e8490375f89dae9a926a84ede69f12178.tar.gz
Use $args{name} outside of subref to avoid memory leak.
-rw-r--r--lib/Net/HTTP/Spore/Meta/Method.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Net/HTTP/Spore/Meta/Method.pm b/lib/Net/HTTP/Spore/Meta/Method.pm
index 2e55a89..b3a0c6a 100644
--- a/lib/Net/HTTP/Spore/Meta/Method.pm
+++ b/lib/Net/HTTP/Spore/Meta/Method.pm
@@ -133,10 +133,11 @@ has documentation => (
 sub wrap {
     my ( $class, %args ) = @_;
 
+    my $name = $args{name};
     my $code = sub {
         my ( $self, %method_args ) = @_;
 
-        my $method = $self->meta->find_spore_method_by_name( $args{name} );
+        my $method = $self->meta->find_spore_method_by_name( $name );
 
         my $payload =
           ( defined $method_args{spore_payload} )