Free device info list.

This commit is contained in:
2019-10-13 14:11:54 +01:00
parent 9d1b0d7670
commit 71ba668c44
3 changed files with 19 additions and 1 deletions

View File

@@ -82,5 +82,6 @@ typedef struct DeviceInfoList
#pragma pack(pop)
DeviceInfoList* ListDevices();
void FreeDeviceInfoList(DeviceInfoList* start);
#endif

View File

@@ -21,11 +21,26 @@
#include "linux/linux.h"
#endif
#include <stddef.h>
#include <stdlib.h>
DeviceInfoList* ListDevices()
{
#if defined(__linux__) && !defined(__ANDROID__)
return linux_list_devices();
#else
return 0;
return NULL;
#endif
}
void FreeDeviceInfoList(DeviceInfoList* start)
{
DeviceInfoList* current;
while(start)
{
current = start;
start = current->next;
free(current);
}
}

2
main.c
View File

@@ -317,6 +317,8 @@ int main()
continue;
}
FreeDeviceInfoList(deviceInfoList);
printf("List devices not yet implemented, skipping...\n");
continue;
case DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES: