Commit 937db9ab authored by Mart Lubbers's avatar Mart Lubbers
Browse files

fix free

parent f679e433
...@@ -158,7 +158,7 @@ unsigned long *errcl = NULL; ...@@ -158,7 +158,7 @@ unsigned long *errcl = NULL;
void ttyerror(CleanString *result) void ttyerror(CleanString *result)
{ {
debug("ttyerror"); debug("ttyerror");
if(errcl == NULL) if(errcl != NULL)
free(errcl); free(errcl);
errcl = my_malloc( errcl = my_malloc(
sizeof(unsigned long)*CleanStringSizeInts(strlen(error))); sizeof(unsigned long)*CleanStringSizeInts(strlen(error)));
...@@ -184,7 +184,7 @@ void ttyreadline(int fd, CleanString *result, int *fdo) ...@@ -184,7 +184,7 @@ void ttyreadline(int fd, CleanString *result, int *fdo)
} }
buf[charsread] = '\0'; buf[charsread] = '\0';
if(readlinecl == NULL) if(readlinecl != NULL)
free(readlinecl); free(readlinecl);
readlinecl = my_malloc( readlinecl = my_malloc(
sizeof(unsigned long)*CleanStringSizeInts(charsread)); sizeof(unsigned long)*CleanStringSizeInts(charsread));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment