sub shm BUGFIX correctly handle empty updated edits
Fixes
@@ -693,10 +693,11 @@ sr_shmsub_change_notify_update(struct sr_mod_info_s *mod_info, sr_sid_t sid, uin
/* SUB READ UNLOCK */
sr_rwunlock(&multi_sub_shm->lock, SR_LOCK_READ, __func__);
- /* collect new edits */
- if (!*update_edit) {
+ /* collect new edits (resulting edit may be empty) */
+ if (!*update_edit || !edit) {
+ lyd_free_withsiblings(*update_edit);
*update_edit = edit;
- } else {
+ } else if (edit) {
if (lyd_insert_after((*update_edit)->prev, edit)) {
sr_errinfo_new_ly(&err_info, ly_ctx);
goto cleanup;
