[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] rewrote home_dir() to fix memleak
From: |
Tim Ruehsen |
Subject: |
Re: [Bug-wget] [PATCH] rewrote home_dir() to fix memleak |
Date: |
Thu, 12 Apr 2012 14:45:24 +0200 |
User-agent: |
KMail/1.13.7 (Linux/3.2.0-2-amd64; KDE/4.7.4; x86_64; ; ) |
Sorry to say this, there is a little bug in my changes:
if (!p || !asprintf(&home,"%.*s", (int)(p - path), path))
return NULL;
should be
if (!p || asprintf(&home,"%.*s", (int)(p - path), path) == -1)
return NULL;
What about the 'remove trailing path seperator' code.
I think it is not need, since on most systems 'path/filename' is treated the
same as 'path//filename'.
What do you think ?
Mit freundlichem Gruß
Tim Rühsen