Browse Source

Prevent memory leak on error.

Georgi Chorbadzhiyski 9 years ago
parent
commit
39377eeeca
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      data.c

+ 1
- 1
data.c View File

351
 	char tmp[9];
351
 	char tmp[9];
352
 	unsigned i, pos;
352
 	unsigned i, pos;
353
 
353
 
354
-	NIT *n = calloc(1, sizeof(NIT));
355
 	if (strlen(freq) != 9 || strlen(symbol_rate) != 8)
354
 	if (strlen(freq) != 9 || strlen(symbol_rate) != 8)
356
 		return NULL;
355
 		return NULL;
356
+	NIT *n = calloc(1, sizeof(NIT));
357
 	n->freq        = strdup(freq);
357
 	n->freq        = strdup(freq);
358
 	n->modulation  = strdup(mod);
358
 	n->modulation  = strdup(mod);
359
 	n->symbol_rate = strdup(symbol_rate);
359
 	n->symbol_rate = strdup(symbol_rate);

Loading…
Cancel
Save