diff options
-rw-r--r-- | lib/execute.c | 6 | ||||
-rw-r--r-- | lib/rlib.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/execute.c b/lib/execute.c index 3bf3c4b..195d783 100644 --- a/lib/execute.c +++ b/lib/execute.c @@ -343,7 +343,13 @@ struct vari* _variablesNew(variables* vars, const char* name, /* Oops! */ if(!v->name || !v->value) + { + if(v->name) + free(v->name); + if(v->value) + free(v->value); return NULL; + } vars->cur++; @@ -55,7 +55,11 @@ int rlibInit(r_stream* stream, long options) /* Init the stream for the current session */ if(!vmInit(stream)) + { + free(state); + stream->state = NULL; return R_NOMEM; + } state->options = options; |