snmpapi: Fix memory allocation in SnmpUtilVarBindListCpy.

This commit is contained in:
Hans Leidekker 2007-10-26 23:18:38 +02:00 committed by Alexandre Julliard
parent 1f632a29ce
commit a5fba22a79
1 changed files with 2 additions and 4 deletions

View File

@ -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++)