ObjFW  Check-in [7ed1bdc642]

Overview
Comment:Fix a memory leak
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7ed1bdc642d5435851413c52062c807d7cb7649f9681650607bc6d14c715cea3
User & Date: js on 2019-11-24 22:42:40
Other Links: manifest | tags
Context
2019-11-24
23:57
runtime: Always set class->isa->isa correctly check-in: 3cc333fb2f user: js tags: trunk
22:42
Fix a memory leak check-in: 7ed1bdc642 user: js tags: trunk
22:23
runtime: Remove duplicate structs for ABI check-in: c6d2de4312 user: js tags: trunk
Changes

Modified src/OFASN1BitString.m from [733ec1dedf] to [9190f46a2e].

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
		if (count == 1 && unusedBits != 0)
			@throw [OFInvalidFormatException exception];

		if (SIZE_MAX / 8 < count - 1)
			@throw [OFOutOfRangeException exception];

		bitStringLength = (count - 1) * 8;
		bitStringValue = [[DEREncodedContents
		    subdataWithRange: of_range(1, count - 1)] copy];

		if (unusedBits != 0)
			bitStringLength -= unusedBits;
	} @catch (id e) {
		[self release];
		@throw e;
	}







|
|







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
		if (count == 1 && unusedBits != 0)
			@throw [OFInvalidFormatException exception];

		if (SIZE_MAX / 8 < count - 1)
			@throw [OFOutOfRangeException exception];

		bitStringLength = (count - 1) * 8;
		bitStringValue = [DEREncodedContents subdataWithRange:
		    of_range(1, count - 1)];

		if (unusedBits != 0)
			bitStringLength -= unusedBits;
	} @catch (id e) {
		[self release];
		@throw e;
	}

Modified tests/OFBlockTests.m from [a74daa9112] to [44397683bc].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
static void (^g)(void) = ^ {};

static int
(^returnStackBlock(void))(void)
{
	__block int i = 42;

	return Block_copy(^ int { return ++i; });
}

static double
forwardTest(void)
{
	__block double d;
	void (^b)(void) = Block_copy(^ {







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
static void (^g)(void) = ^ {};

static int
(^returnStackBlock(void))(void)
{
	__block int i = 42;

	return [Block_copy(^ int { return ++i; }) autorelease];
}

static double
forwardTest(void)
{
	__block double d;
	void (^b)(void) = Block_copy(^ {