netlink: in snl_init_writer() don't overwrite error in case of failure
PR: 290050
This commit is contained in:
committed by
Gleb Smirnoff
parent
a25cfcab9a
commit
488718ff42
@@ -1068,14 +1068,14 @@ snl_init_writer(struct snl_state *ss, struct snl_writer *nw)
|
|||||||
{
|
{
|
||||||
nw->size = SNL_WRITER_BUFFER_SIZE;
|
nw->size = SNL_WRITER_BUFFER_SIZE;
|
||||||
nw->base = (char *)snl_allocz(ss, nw->size);
|
nw->base = (char *)snl_allocz(ss, nw->size);
|
||||||
if (nw->base == NULL) {
|
if (__predict_false(nw->base == NULL)) {
|
||||||
nw->error = true;
|
nw->error = true;
|
||||||
nw->size = 0;
|
nw->size = 0;
|
||||||
}
|
} else
|
||||||
|
nw->error = false;
|
||||||
|
|
||||||
nw->offset = 0;
|
nw->offset = 0;
|
||||||
nw->hdr = NULL;
|
nw->hdr = NULL;
|
||||||
nw->error = false;
|
|
||||||
nw->ss = ss;
|
nw->ss = ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user