Skip to content

Commit dcae84e

Browse files
jeremie6windRoytak
authored andcommitted
io UPDATE return if buffer is unused
1 parent 26dcf6e commit dcae84e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/io.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,16 @@ nc_read_msg_poll_io(struct nc_session *session, int io_timeout, struct ly_in **m
484484

485485
/* read msg */
486486
ret = nc_read_msg_io(session, io_timeout, 1, &buf, &buf_len);
487-
if (ret > 0) {
488-
ret = 1;
489-
}
490487

491488
/* SESSION IO UNLOCK */
492489
nc_session_io_unlock(session, __func__);
493490

491+
if (ret > 0) {
492+
ret = 1;
493+
} else {
494+
return ret;
495+
}
496+
494497
/* create input */
495498
if (ly_in_new_memory(buf, msg)) {
496499
free(buf);

0 commit comments

Comments
 (0)