DWORD unitmask = lpdbv->dbcv_unitmask;
int i, j, count;
char drive_name_upper, drive_name_lower;
- ULONG_PTR* keys;
+ ULONG_PTR* keys = NULL;
DEVICE_DRIVE_EXT* device_ext;
UINT32 ids[1];
}
}
}
+
+ free(keys);
}
unitmask = unitmask >> 1;
hotplug_dev dev_array[MAX_USB_DEVICES];
int count;
DEVICE_DRIVE_EXT* device_ext;
- ULONG_PTR* keys;
+ ULONG_PTR* keys = NULL;
int i, j;
int size = 0;
UINT error;
}
cleanup:
+ free(keys);
for (i = 0; i < size; i++)
free(dev_array[i].path);
c = fgetc(fd);
if (ferror(fd))
+ {
+ free(newbuf);
return NULL;
+ }
if (c == EOF)
{
int i, j;
int size = 0;
int count;
- ULONG_PTR* keys;
+ ULONG_PTR* keys = NULL;
UINT32 ids[1];
UINT error = 0;
memset(dev_array, 0, sizeof(dev_array));
}
cleanup:
+ free(keys);
for (i = 0; i < size; i++)
free(dev_array[i].path);
if (!s)
{
+ free(computerNameW);
WLog_ERR(TAG, "Stream_New failed!");
return CHANNEL_RC_NO_MEMORY;
}
size_t count_pos;
DEVICE* device;
int keyCount;
- ULONG_PTR* pKeys;
+ ULONG_PTR* pKeys = NULL;
s = Stream_New(NULL, 256);
if (!s)
if (!Stream_EnsureRemainingCapacity(s, 20 + data_len))
{
+ free(pKeys);
+ Stream_Free(s, TRUE);
WLog_ERR(TAG, "Stream_EnsureRemainingCapacity failed!");
return ERROR_INVALID_DATA;
}
int index;
int keyCount;
DEVICE* device;
- ULONG_PTR* pKeys;
+ ULONG_PTR* pKeys = NULL;
UINT error = CHANNEL_RC_OK;
pKeys = NULL;
keyCount = ListDictionary_GetKeys(rdpdr->devman->devices, &pKeys);
{
WLog_ERR(TAG,
"rdpdr_server_write_general_capability_set failed with error %"PRIu32"!", error);
- return error;
+ goto out;
}
if (context->supportsDrives)
{
WLog_ERR(TAG, "rdpdr_server_write_drive_capability_set failed with error %"PRIu32"!",
error);
- return error;
+ goto out;
}
}
{
WLog_ERR(TAG, "rdpdr_server_write_port_capability_set failed with error %"PRIu32"!",
error);
- return error;
+ goto out;
}
}
{
WLog_ERR(TAG,
"rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error);
- return error;
+ goto out;
}
}
{
WLog_ERR(TAG,
"rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error);
- return error;
+ goto out;
}
}
(PCHAR) Stream_Buffer(s), Stream_Length(s), &written);
Stream_Free(s, TRUE);
return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
+out:
+ Stream_Free(s, TRUE);
+ return error;
}
/**