Make sure global state gets NULLed on free
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 15 Jan 2009 07:22:58 +0000 (09:22 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 15 Jan 2009 07:22:58 +0000 (09:22 +0200)
- otherwise repeated read config -> free config like rpmbuild does
  will crash and burn
- somewhat kludgy, figure a better way to do this

rpmio/rpmlua.c

index 4afa8d5..133fa16 100644 (file)
@@ -84,6 +84,7 @@ void *rpmluaFree(rpmlua lua)
        if (lua->L) lua_close(lua->L);
        free(lua->printbuf);
        free(lua);
+       if (lua == globalLuaState) globalLuaState = NULL;
     }
     return NULL;
 }