Close open file descriptor if the version is wrong (Coverity CID 1164481).

This commit is contained in:
Petter Reinholdtsen 2014-01-26 09:58:04 +00:00
parent 568c01bbb5
commit 1c9808ec42

View File

@ -466,8 +466,10 @@ int receive_state(int fd)
f = fdopen(fd, "r"); f = fdopen(fd, "r");
if (get_cmd(f) != C_VER) if (get_cmd(f) != C_VER) {
fclose(f);
return -1; return -1;
}
get_string(old_version, sizeof(old_version), f); get_string(old_version, sizeof(old_version), f);
oops_error = 0; oops_error = 0;
for (pp = &family; (*pp = get_record(f)) != NULL; pp = &((*pp)->next)) for (pp = &family; (*pp = get_record(f)) != NULL; pp = &((*pp)->next))