# HG changeset patch # User Space Falcon # Date 1438478589 0 # Node ID 52000ae7a6cf5c35471ed70c48518d926ecbeae9 # Parent e86258830e19a2ca0c59d81fab77c915815feea3 ueda/libunet/unetrd.c: close the stdio stream on EOF diff -r e86258830e19 -r 52000ae7a6cf ueda/libunet/unetrd.c --- a/ueda/libunet/unetrd.c Sun Aug 02 01:13:43 2015 +0000 +++ b/ueda/libunet/unetrd.c Sun Aug 02 01:23:09 2015 +0000 @@ -170,8 +170,10 @@ /* read lines until we get a non-empty, non-comment line or EOF */ for (;;) { - if (!fgets(linebuf, sizeof linebuf, state->stream)) + if (!fgets(linebuf, sizeof linebuf, state->stream)) { + fclose(state->stream); return(0); + } state->lineno++; cp = index(linebuf, '\n'); if (!cp) {