Merge pull request #2 from jan-schreib/malloc-checks

add malloc check
This commit is contained in:
Rafał Leśniak 2015-11-06 22:34:40 +01:00
commit 9b85a5b010

View file

@ -33,6 +33,7 @@
#include <stdint.h>
#include <ctype.h>
#include <fcntl.h>
#include <err.h>
#define PPPPROTO_CTL 1
@ -259,8 +260,8 @@ static void allocate_data_buffer(int size)
if (data_buffer_length < size)
{
free(data_buffer);
data_buffer_length = size;
data_buffer = malloc(data_buffer_length);
if ((data_buffer = malloc(size)) == NULL)
err(1, NULL);
}
}