Fix freeing of a stack allocation. Fix bad LC_ASSERT definition on non-Windows platforms

This commit is contained in:
Cameron Gutman 2014-01-20 21:55:48 -05:00
parent 462b1d1e9b
commit 00de922f34
2 changed files with 7 additions and 2 deletions

View File

@ -25,5 +25,5 @@
#include <crtdbg.h>
#define LC_ASSERT _ASSERTE
#else
#define LC_ASSERT
#define LC_ASSERT(x)
#endif

View File

@ -131,7 +131,7 @@ static void DecoderThreadProc(void* context) {
}
int readFirstFrame(void) {
char firstFrame[1000];
char* firstFrame;
int err;
int offset = 0;
@ -140,6 +140,11 @@ int readFirstFrame(void) {
return LastSocketError();
}
firstFrame = (char*)malloc(1500);
if (firstFrame == NULL) {
return -1;
}
Limelog("Waiting for first frame\n");
for (;;) {
err = recv(firstFrameSocket, &firstFrame[offset], sizeof(firstFrame) - offset, 0);