Fix deleteEnv null-pointer bug.
This commit is contained in:
parent
c0ad4481bd
commit
d73247a471
|
@ -180,6 +180,7 @@ void addFunc(const char *name, Object (*func)(Object, Object, struct Environment
|
||||||
|
|
||||||
void deleteEnv(struct Environment *e)
|
void deleteEnv(struct Environment *e)
|
||||||
{
|
{
|
||||||
|
if (e->strings) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(e->strings[i]) {
|
while(e->strings[i]) {
|
||||||
free(e->strings[i]);
|
free(e->strings[i]);
|
||||||
|
@ -191,6 +192,7 @@ void deleteEnv(struct Environment *e)
|
||||||
|
|
||||||
free(e->objects);
|
free(e->objects);
|
||||||
e->objects = NULL;
|
e->objects = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct symFunc {
|
struct symFunc {
|
||||||
|
|
Loading…
Reference in New Issue