diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-01-27 03:14:04 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-01-27 03:14:04 +0000 |
| commit | 33a155e400ad53ef923e902dad4881909677f005 (patch) | |
| tree | c9161d7d9c624660bfff148e67b1c41802a1479c | |
| parent | d13d6a9ed2d812b8ad3260454a4b3b494842d6b0 (diff) | |
Notes
| -rw-r--r-- | lib/libutil/property.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libutil/property.c b/lib/libutil/property.c index 91270f8795c3..0a31879ab609 100644 --- a/lib/libutil/property.c +++ b/lib/libutil/property.c @@ -90,11 +90,14 @@ properties_read(int fd) } switch(state) { case FILL: - if ((max = read(fd, buf, sizeof buf)) <= 0) { + if ((max = read(fd, buf, sizeof buf)) < 0) { + properties_free(head); + return (NULL); + } + if (max == 0) { state = STOP; break; - } - else { + } else { state = LOOK; ch = buf[0]; bp = 1; |
