RFR JDK-8007609
Alan Bateman
Alan.Bateman at oracle.com
Wed Feb 6 15:02:28 UTC 2013
On 06/02/2013 14:57, John Zavgren wrote:
> Alan: I like your change, but I think the free(result) statement would
> need to be eliminated, otherwise the block a few lines later: /*
> Unable to get final path. */ if(len == 0 && result != NULL) {
> free(result); result = NULL; } would cause result to be freed twice.
Shouldn't do because result = newResult and so will be NULL.
An alternative would be:
WCHAR* newResult = (WCHAR*)realloc(...);
if (newResult != NULL) {
result = newResult;
len = (*GetFinalPathNameByHandle_func)( h, result, len, 0);
} else {
len = 0;
}
which might be clearer.
-Alan.
More information about the core-libs-dev
mailing list