Differences From Artifact [4c3b80addf]:
- File
src/OFString+URLEncoding.m
— part of check-in
[0ddaac3f5b]
at
2020-11-05 00:24:29
on branch trunk
— Avoid -[allocMemoryWithSize:] for temporary memory
-[allocMemoryWithSize:] has book keeping overhead that is unnecessary
for temporary memory. (user: js, size: 3519) [annotate] [blame] [check-ins using]
To Artifact [329955234f]:
- File
src/OFString+URLEncoding.m
— part of check-in
[a2b4238850]
at
2020-11-06 02:24:14
on branch trunk
— Future-proof some code using freeWhenDone
While -[OFData initWithDataNoCopy:count:itemSize:freeWhenDone:] can
currently never throw, it might in the future, and when it does so in
the future, these would be memory leaks then. (user: js, size: 3584) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
136 137 138 139 140 141 142 | @try { retCString = of_realloc(retCString, 1, i + 1); } @catch (OFOutOfMemoryException *e) { /* We don't care if it fails, as we only made it smaller. */ } | > | | | > > > | > | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | @try { retCString = of_realloc(retCString, 1, i + 1); } @catch (OFOutOfMemoryException *e) { /* We don't care if it fails, as we only made it smaller. */ } @try { return [OFString stringWithUTF8StringNoCopy: retCString length: i freeWhenDone: true]; } @catch (id e) { free(retCString); @throw e; } } @end |