Hans Leidekker : snmpapi: Fix memory allocation in SnmpUtilVarBindListCpy.
Alexandre Julliard
julliard at winehq.org
Mon Oct 29 08:34:46 CDT 2007
Module: wine
Branch: master
Commit: a5fba22a79e7a1f5429e0c973c7ff1941d392f58
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a5fba22a79e7a1f5429e0c973c7ff1941d392f58
Author: Hans Leidekker <hans at it.vu.nl>
Date: Fri Oct 26 23:18:38 2007 +0200
snmpapi: Fix memory allocation in SnmpUtilVarBindListCpy.
---
dlls/snmpapi/main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/snmpapi/main.c b/dlls/snmpapi/main.c
index 34073c3..3686ed9 100644
--- a/dlls/snmpapi/main.c
+++ b/dlls/snmpapi/main.c
@@ -431,12 +431,10 @@ INT WINAPI SnmpUtilVarBindListCpy(SnmpVarBindList *dst, SnmpVarBindList *src)
dst->len = 0;
return SNMPAPI_NOERROR;
}
- size = src->len * sizeof(SnmpVarBind *);
+ size = src->len * sizeof(SnmpVarBind);
if (!(dst->list = HeapAlloc(GetProcessHeap(), 0, size)))
- {
- HeapFree(GetProcessHeap(), 0, dst);
return SNMPAPI_ERROR;
- }
+
src_entry = src->list;
dst_entry = dst->list;
for (i = 0; i < src->len; i++)
More information about the wine-cvs
mailing list