mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
twain_32: Replace realloc() and strdup().
This commit is contained in:
parent
250b699354
commit
820981b39d
1 changed files with 4 additions and 3 deletions
|
@ -84,10 +84,11 @@ twain_add_onedriver(const char *dsname) {
|
|||
if (i < nrdevices)
|
||||
break;
|
||||
if (nrdevices)
|
||||
devices = realloc(devices, sizeof(devices[0])*(nrdevices+1));
|
||||
devices = HeapReAlloc(GetProcessHeap(), 0, devices, sizeof(devices[0])*(nrdevices+1));
|
||||
else
|
||||
devices = malloc(sizeof(devices[0]));
|
||||
devices[nrdevices].modname = strdup(dsname);
|
||||
devices = HeapAlloc(GetProcessHeap(), 0, sizeof(devices[0]));
|
||||
if ((devices[nrdevices].modname = HeapAlloc(GetProcessHeap(), 0, strlen(dsname) + 1)))
|
||||
lstrcpyA(devices[nrdevices].modname, dsname);
|
||||
devices[nrdevices].identity = sourceId;
|
||||
nrdevices++;
|
||||
DSM_sourceId++;
|
||||
|
|
Loading…
Reference in a new issue