Hi John,
in the cleanup, would it be necessary to free the allocated pathv
array also, prior to return?
if I'm not misreading.
Also, rather than storing the pointer to the string literal, malloc
(NEW) and memcpy as per the other entries.
This will avoid potential conflict should other code attempt to release
the pathv, which would be unaware
of it containing the string literal. (Who cleans up pathv after it has
been used?)
regards
Mark
On 21/03/2013 18:36, John Zavgren wrote:
All:
How does this look?
1.) I reverted the for statement formatting change.
2.) I removed the goto statement and "inlined" some code instead.
3.) I checked to make sure that we're not freeing memory that we didn't
actually allocate. (Path vector elements that are empty.)
http://cr.openjdk.java.net/~jzavgren/8008118/webrev.04/
John
----- Original Message -----
From: chris...@zoulas.com
To: marti...@google.com, john.zavg...@oracle.com
Cc: core-libs-dev@openjdk.java.net
Sent: Thursday, March 21, 2013 2:00:10 PM GMT -05:00 US/Canada Eastern
Subject: Re: RFR-8008118
On Mar 21, 10:10am, marti...@google.com (Martin Buchholz) wrote:
-- Subject: Re: RFR-8008118
| Please revert this formatting change:
|
| - for (q = p; (*q != ':') && (*q != '\0'); q++)
| - ;
| + for (q = p; (*q != ':') && (*q != '\0'); q++);
| +
|
Stylistically I prefer:
for (q = p; (*q != ':') && (*q != '\0'); q++)
continue;
so that re-formatting accidents don't happen, and the intent is clearly
communicated.
christos