CoreFW  Check-in [d416cefb3b]

Overview
Comment:Fix a memory leak in map.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d416cefb3b6c0c989b45c856ec861d5393ccbe7cdaef12da5719e5f573b9776a
User & Date: js on 2012-09-30 00:25:00
Other Links: manifest | tags
Context
2012-09-30
00:59
Fix cfw_strndup() and add cfw_strnlen(). check-in: 3247812f3b user: js tags: trunk
00:25
Fix a memory leak in map. check-in: d416cefb3b user: js tags: trunk
2012-09-29
23:22
Add cfw_string_set_nocopy(). check-in: ebf63ac6c8 user: js tags: trunk
Changes

Modified src/map.c from [c5e3bf3b39] to [30449aad8d].

65
66
67
68
69
70
71

72
73
74
75
76
77
78
	CFWMap *map = ptr;
	uint32_t i;

	for (i = 0; i < map->size; i++) {
		if (map->data[i] != NULL && map->data[i] != &deleted) {
			cfw_unref(map->data[i]->key);
			cfw_unref(map->data[i]->obj);

		}
	}

	if (map->data != NULL)
		free(map->data);
}








>







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
	CFWMap *map = ptr;
	uint32_t i;

	for (i = 0; i < map->size; i++) {
		if (map->data[i] != NULL && map->data[i] != &deleted) {
			cfw_unref(map->data[i]->key);
			cfw_unref(map->data[i]->obj);
			free(map->data[i]);
		}
	}

	if (map->data != NULL)
		free(map->data);
}