Differences From Artifact [5d08b70ba3]:
- File src/OFString+XMLEscaping.m — part of check-in [d0ae3bfd6c] at 2020-10-25 23:33:09 on branch trunk — Add of_{malloc,calloc,realloc,free} (user: js, size: 2241) [annotate] [blame] [check-ins using]
To Artifact [bd600aa82b]:
- File
src/OFString+XMLEscaping.m
— part of check-in
[3d8286feee]
at
2020-11-04 23:18:25
on branch trunk
— Remove of_free()
While it makes sense to wrap malloc and calloc to replace the error
checking with exceptions, it does not make sense to wrap free. (user: js, size: 2235) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
80 81 82 83 84 85 86 | } if (append != NULL) { @try { retCString = of_realloc(retCString, 1, retLength + appendLen); } @catch (id e) { | | | | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | } if (append != NULL) { @try { retCString = of_realloc(retCString, 1, retLength + appendLen); } @catch (id e) { free(retCString); @throw e; } retLength += appendLen - 1; memcpy(retCString + j, append, appendLen); j += appendLen; } else retCString[j++] = string[i]; } assert(j == retLength); objc_autoreleasePoolPop(pool); @try { ret = [OFString stringWithUTF8String: retCString length: retLength]; } @finally { free(retCString); } return ret; } @end |