CoreFW  Check-in [c3a601908a]

Overview
Comment:Add missing NULL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c3a601908a66475d0f12ffeff282056b9bf3194af4faf9cda14533fc94bbe8a0
User & Date: js on 2012-04-22 02:34:54
Other Links: manifest | tags
Context
2012-04-22
02:34
Add map. check-in: 1965a6ab9e user: js tags: trunk
02:34
Add missing NULL. check-in: c3a601908a user: js tags: trunk
02:34
ctor: Set pointers to NULL before allocation. check-in: bdb850f3e2 user: js tags: trunk
Changes

Modified src/array.c from [203632d233] to [ce9d8b0bdd].

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
static void*
copy(void *ptr)
{
	CFWArray *array = ptr;
	CFWArray *new;
	size_t i;

	if ((new = cfw_new(cfw_array)) == NULL)
		return NULL;

	if ((new->data = malloc(sizeof(void*) * array->size)) == NULL) {
		cfw_unref(new);
		return NULL;
	}
	new->size = array->size;







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
static void*
copy(void *ptr)
{
	CFWArray *array = ptr;
	CFWArray *new;
	size_t i;

	if ((new = cfw_new(cfw_array, NULL)) == NULL)
		return NULL;

	if ((new->data = malloc(sizeof(void*) * array->size)) == NULL) {
		cfw_unref(new);
		return NULL;
	}
	new->size = array->size;

Modified src/string.c from [5092f0f99a] to [0d338be9da].

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)
		return NULL;

	if ((new->data = malloc(str->len + 1)) == NULL) {
		cfw_unref(new);
		return NULL;
	}
	new->len = str->len;







|







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;