Commit b879d225 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix handling of error in update_datum.

Thanks to Antonin Décimo.
parent 8bf2f920
...@@ -143,13 +143,8 @@ update_datum(const unsigned char *key, int keylen, ...@@ -143,13 +143,8 @@ update_datum(const unsigned char *key, int keylen,
return NULL; return NULL;
datum = calloc(1, sizeof(struct datum) + keylen + vallen); datum = calloc(1, sizeof(struct datum) + keylen + vallen);
if(datum == NULL) { if(datum == NULL)
if(updated != NULL)
*updated = 0;
if(conflict != NULL)
*conflict = 0;
return NULL; return NULL;
}
datum->seqno = seqno; datum->seqno = seqno;
datum->keylen = keylen; datum->keylen = keylen;
...@@ -591,7 +586,7 @@ parse_tlv(struct neighbour *neigh) ...@@ -591,7 +586,7 @@ parse_tlv(struct neighbour *neigh)
datum = update_datum(body + 7, keylen, seqno, datum = update_datum(body + 7, keylen, seqno,
body + 7 + keylen, len - keylen - 7, body + 7 + keylen, len - keylen - 7,
time, &doit, &conflict); time, &doit, &conflict);
if(doit) { if(datum != NULL && doit) {
if(datum_callback != NULL) if(datum_callback != NULL)
datum_callback(datum, conflict); datum_callback(datum, conflict);
flood(datum, neigh); flood(datum, neigh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment