CoreFW  Check-in [01129bb203]

Overview
Comment:Fix a leak in map.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 01129bb20392621f52c8e5b237ecba86b0518b01ffa488ec76f801226c2d8525
User & Date: js on 2012-09-30 02:56:53
Other Links: manifest | tags
Context
2012-09-30
02:57
Fix a bug in refpool. check-in: d7b09f1d63 user: js tags: trunk
02:56
Fix a leak in map. check-in: 01129bb203 user: js tags: trunk
02:21
Add cfw_map_{get,set}_c() for convenience. check-in: 082d69b467 user: js tags: trunk
Changes

Modified src/map.c from [6c8dd7f75d] to [01e60939fa].

337
338
339
340
341
342
343
344


345

346
347
348
349
350
351
352
337
338
339
340
341
342
343

344
345
346
347
348
349
350
351
352
353
354







-
+
+

+








		if (i >= last)
			return false;

		if ((bucket = malloc(sizeof(*bucket))) == NULL)
			return false;

		if ((bucket->key = cfw_copy(key)) == NULL)
		if ((bucket->key = cfw_copy(key)) == NULL) {
			free(bucket);
			return false;
		}

		bucket->obj = cfw_ref(obj);
		bucket->hash = cfw_hash(key);

		map->data[i] = bucket;
		map->items++;