Fix leak in oc_sdi
@@ -108,8 +108,10 @@ oc_sec_decode_sdi(oc_rep_t *rep, bool from_storage, size_t device)
if (oc_string_len(s->name) > 0) {
oc_free_string(&s->name);
}
+ if (oc_string_len(rep->value.string) > 0) {
oc_new_string(&s->name, oc_string(rep->value.string),
oc_string_len(rep->value.string));
+ }
suc = true;
} else {
OC_ERR("oc_sdi: Unknown property %s", oc_string(rep->name));
