On Thu Dec 14 06:44:16 2006, SISYPHUS wrote:
Show quoted text> On Win32, perl 5.8.8, libssh2-0.14, Net-SSH2-0.09, the "free(auth);"
> in the net_ss_auth_list() function produces a "Free to wrong
pool ..."
Show quoted text> (fatal) error. One way of fixing this problem is to simply comment
out
Show quoted text> that line of code. But I'm not so sure that is the correct fix.
(Does
Show quoted text> that so-called "fix" create the potential for a memory leak ?)
>
> I'd be interested to get some feedback on this as I *really* don't
> know what the appropriate course of action is.
>
> I note that one of the 'if' blocks in net_ss_auth_password() also
> contains similar code ... I haven't tested to see whether that
results
Show quoted text> in the same error.
>
> Cheers,
> Rob
Seems to me that the same problem *does* occur with
net_ss_auth_password. Just so there's no doubt, here's a diff on the
XS file I eventually used, run against the XS file that ships with the
Net-SSH2-0.09 source:
--- SSH2.xs_old 2006-09-02 12:09:16.000000000 +1000
+++ SSH2.xs 2006-12-15 16:04:36.000000000 +1100
@@ -754,7 +754,7 @@
count = split_comma(sp, auth);
else
PUSHs(sv_2mortal(newSVpv(auth, 0)));
- free(auth);
+ //free(auth);
XSRETURN(count);
void
@@ -781,7 +781,7 @@
if (!password || !SvPOK(password)) {
char* auth = libssh2_userauth_list(ss->session,
pv_username, len_username);
- free(auth);
+ //free(auth);
XSRETURN_IV(!auth && libssh2_userauth_authenticated(ss-
Show quoted text>session));
}
Again, I stress that I don't know if that's the correct fix.
Cheers,
Rob