Andrew Talbot : winemp3.acm: Replace malloc() with HeapAlloc().
Alexandre Julliard
julliard at winehq.org
Fri Feb 13 08:59:19 CST 2009
Module: wine
Branch: master
Commit: 5a556de5a0980b34e47e9bb633965204e6356291
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5a556de5a0980b34e47e9bb633965204e6356291
Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date: Thu Feb 12 19:47:11 2009 +0000
winemp3.acm: Replace malloc() with HeapAlloc().
---
dlls/winemp3.acm/interface.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/winemp3.acm/interface.c b/dlls/winemp3.acm/interface.c
index 1511cbb..6592902 100644
--- a/dlls/winemp3.acm/interface.c
+++ b/dlls/winemp3.acm/interface.c
@@ -18,8 +18,11 @@
#include "config.h"
#include <stdlib.h>
+#include <stdarg.h>
#include <stdio.h>
+#include "windef.h"
+#include "winbase.h"
#include "wine/debug.h"
#include "mpg123.h"
#include "mpglib.h"
@@ -57,9 +60,9 @@ void ClearMP3Buffer(struct mpstr *mp)
b = mp->tail;
while(b) {
- free(b->pnt);
+ HeapFree(GetProcessHeap(), 0, b->pnt);
bn = b->next;
- free(b);
+ HeapFree(GetProcessHeap(), 0, b);
b = bn;
}
mp->tail = NULL;
@@ -71,14 +74,14 @@ static struct buf *addbuf(struct mpstr *mp,const unsigned char *buf,int size)
{
struct buf *nbuf;
- nbuf = malloc( sizeof(struct buf) );
+ nbuf = HeapAlloc(GetProcessHeap(), 0, sizeof(struct buf));
if(!nbuf) {
WARN("Out of memory!\n");
return NULL;
}
- nbuf->pnt = malloc(size);
+ nbuf->pnt = HeapAlloc(GetProcessHeap(), 0, size);
if(!nbuf->pnt) {
- free(nbuf);
+ HeapFree(GetProcessHeap(), 0, nbuf);
WARN("Out of memory!\n");
return NULL;
}
@@ -112,8 +115,8 @@ static void remove_buf(struct mpstr *mp)
mp->tail = mp->head = NULL;
}
- free(buf->pnt);
- free(buf);
+ HeapFree(GetProcessHeap(), 0, buf->pnt);
+ HeapFree(GetProcessHeap(), 0, buf);
}
More information about the wine-cvs
mailing list