src/script.c: get rid of lazy allocation functions