On Tue, 2014-04-15 at 13:29 +0200, Samuel Thibault wrote:
> Svante Signell, le Tue 15 Apr 2014 12:07:22 +0200, a écrit :
> > > Will obviously crash. Did you try your code at all?
> > 
> > I wrote a test program and run that one through valgind. Better now?
> 
> Did you really make your program go through your patched code?
> 
> > +   dfp = xdstrdup(efp);
> 
> That doesn't get free in the if branch.

How to do that properly then?

> >     if (tmp) {
> > -           fp = tmp + 7;
> > -           if (fp[0] == '/' && fp[2] == ':') {
> > -                   fp++;
> > +           dfp = tmp + 7;
> > +           if (dfp[0] == '/' && dfp[2] == ':') {
> > +                   dfp++;
> >             }
> > -           ret = xdstrdup(fp);
> > +           ret = xdstrdup(dfp);
> > +           free(tmp);
> >  #ifdef PHP_WIN32
> >             l = strlen(ret);
> >             /* convert '/' to '\' */
> > @@ -314,8 +314,8 @@ char *xdebug_path_from_url(const char *f
> >  #endif
> >     } else {
> >             ret = xdstrdup(fileurl);
> > +           free(dfp);
> >     }
> > -
> >     return ret;
> >  }
> >  
> 
> 



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]

Reply via email to