Re: [2/2] kernel32: Don't leak extrabuf when HeapReAlloc fails
30 Jan
2014
30 Jan
'14
4:31 a.m.
On 29 January 2014 23:41, André Hentschel <nerv(a)dawncrow.de> wrote:
- extrabuf = HeapReAlloc( GetProcessHeap(), 0, extrabuf, ebufsize ) ; + if (newbuf = HeapReAlloc( GetProcessHeap(), 0, extrabuf, ebufsize )) + extrabuf = newbuf; + else + break; This will introduce a warning: computername.c: In function ‘dns_gethostbyname’: computername.c:90:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
I happen to think + if (!(newbuf = HeapReAlloc( GetProcessHeap(), 0, extrabuf, ebufsize ))) + break; + extrabuf = newbuf; would be slightly nicer anyway.
4333
Age (days ago)
4333
Last active (days ago)
0 comments
1 participants
participants (1)
-
Henri Verbeet