ObjFW  Check-in [b695a7ad48]

Overview
Comment:OFObject: Fix a missing free
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b695a7ad4843ff7854651d56fec8b73364934eb11e92bd89ccb8964af786d2d9
User & Date: js on 2022-02-22 20:40:25
Other Links: manifest | tags
Context
2022-03-03
21:21
README.md: Add a "Donations" section check-in: 6b8e13fbde user: js tags: trunk
2022-02-22
20:40
OFObject: Fix a missing free check-in: b695a7ad48 user: js tags: trunk
2022-02-12
07:46
Update copyright check-in: 1a86b8175b user: js tags: trunk
Changes

Modified src/OFObject.m from [c94b10de5b] to [8b7ed1ef23].

132
133
134
135
136
137
138
139


140

141
142
143
144
145
146
147
132
133
134
135
136
137
138

139
140
141
142
143
144
145
146
147
148
149







-
+
+

+








	return pointer;
}

void *
OFResizeMemory(void *pointer, size_t count, size_t size)
{
	if OF_UNLIKELY (count == 0 || size == 0)
	if OF_UNLIKELY (count == 0 || size == 0) {
		free(pointer);
		return NULL;
	}

	if OF_UNLIKELY (count > SIZE_MAX / size)
		@throw [OFOutOfRangeException exception];

	if OF_UNLIKELY ((pointer = realloc(pointer, count * size)) == NULL)
		@throw [OFOutOfMemoryException
		    exceptionWithRequestedSize: size];