winealsa: Do not check for non-NULL before HeapFree'ing a variable
as the check is redundant.
Michael Stefaniuc
mstefani at redhat.de
Tue Apr 24 18:13:43 CDT 2007
Found by Smatch.
---
dlls/winealsa.drv/mixer.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/winealsa.drv/mixer.c b/dlls/winealsa.drv/mixer.c
index 4a39d2b..84701f6 100644
--- a/dlls/winealsa.drv/mixer.c
+++ b/dlls/winealsa.drv/mixer.c
@@ -505,10 +505,8 @@ static void ALSA_MixerInit(void)
eclose:
WARN("Error occured initialising mixer: %s\n", snd_strerror(err));
- if (mixdev[mixnum].lines)
- HeapFree(GetProcessHeap(), 0, mixdev[mixnum].lines);
- if (mixdev[mixnum].controls)
- HeapFree(GetProcessHeap(), 0, mixdev[mixnum].controls);
+ HeapFree(GetProcessHeap(), 0, mixdev[mixnum].lines);
+ HeapFree(GetProcessHeap(), 0, mixdev[mixnum].controls);
snd_mixer_close(mixdev[mixnum].mix);
}
cards = mixnum;
@@ -649,8 +647,7 @@ static DWORD WINAPI ALSA_MixerPollThread(LPVOID lParam)
die:
TRACE("Shutting down\n");
- if (pfds)
- HeapFree(GetProcessHeap(), 0, pfds);
+ HeapFree(GetProcessHeap(), 0, pfds);
y = read(msg_pipe[0], &x, sizeof(x));
close(msg_pipe[1]);
--
1.5.0.6
--
Michael Stefaniuc Tel.: +49-711-96437-199
Sr. Network Engineer Fax.: +49-711-96437-111
Red Hat GmbH Email: mstefani at redhat.com
Hauptstaetterstr. 58 http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070425/7a85667b/attachment.pgp
More information about the wine-patches
mailing list