Skip to content

Commit

Permalink
Prevent memory leak on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgi Chorbadzhiyski committed Feb 2, 2015
1 parent cfd3899 commit 39377ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ NIT *nit_new(uint16_t ts_id, char *freq, char *mod, char *symbol_rate) {
char tmp[9];
unsigned i, pos;

NIT *n = calloc(1, sizeof(NIT));
if (strlen(freq) != 9 || strlen(symbol_rate) != 8)
return NULL;
NIT *n = calloc(1, sizeof(NIT));
n->freq = strdup(freq);
n->modulation = strdup(mod);
n->symbol_rate = strdup(symbol_rate);
Expand Down

0 comments on commit 39377ee

Please sign in to comment.