Differences From Artifact [5092f0f99a]:
- File
src/string.c
— part of check-in
[bdb850f3e2]
at
2012-04-22 02:34:50
on branch trunk
— ctor: Set pointers to NULL before allocation.
This way, the dtor can work correctly. (user: js, size: 4120) [annotate] [blame] [check-ins using]
To Artifact [0d338be9da]:
- File src/string.c — part of check-in [c3a601908a] at 2012-04-22 02:34:54 on branch trunk — Add missing NULL. (user: js, size: 4126) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
104 105 106 107 108 109 110 | static void* copy(void *ptr) { CFWString *str = ptr; CFWString *new; | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | static void* copy(void *ptr) { CFWString *str = ptr; CFWString *new; if ((new = cfw_new(cfw_string, NULL)) == NULL) return NULL; if ((new->data = malloc(str->len + 1)) == NULL) { cfw_unref(new); return NULL; } new->len = str->len; |
︙ | ︙ |