diff options
-rw-r--r-- | source4/lib/util/util_file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/util/util_file.c b/source4/lib/util/util_file.c index 99432ad8bb..3451712053 100644 --- a/source4/lib/util/util_file.c +++ b/source4/lib/util/util_file.c @@ -125,6 +125,10 @@ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint) ret = read(fd, data + offset, hint); + if (ret == 0) { + return NULL; + } + if (ret == -1) { talloc_free(data); return NULL; |