Closed szupi-ipuzs closed 6 months ago
Ok, as you can see I decided to make the scanAlloc() method return the number of succesfully allocated items. This can help if realloc() fails - then we still can use the previously allocated buffer if needed. Making this method private should be done as a separate change, since it probably isn't the only one that should be moved.
I have tested this code shortly on bk7231, but not on realtek, since I do not own any realtek device atm (only checked compilation).
This method might return a dynamically allocated buffer which should be freed by the caller (the example code does it). Not doing this results in memory leaks.