diff --git a/src/parser_yin.c b/src/parser_yin.c
index 1f5be28..e708cb2 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -1208,6 +1208,7 @@
     int c_dev = 0, c_must, c_uniq;
     int f_min = 0; /* flags */
     int i, j, rc;
+    struct ly_ctx *ctx;
     struct lys_deviate *d = NULL;
     struct lys_node *node = NULL;
     struct lys_node_choice *choice = NULL;
@@ -1217,6 +1218,8 @@
     uint8_t *trg_must_size = NULL;
     struct lys_restr **trg_must = NULL;
 
+    ctx = module->ctx;
+
     GETVAL(value, yin, "target-node");
     dev->target_name = transform_schema2json(module, value, LOGLINE(yin));
     if (!dev->target_name) {
@@ -1239,7 +1242,7 @@
     LY_TREE_FOR_SAFE(yin->child, next, child) {
         if (!child->ns || strcmp(child->ns->value, LY_NSYIN)) {
             /* garbage */
-            lyxml_free(module->ctx, child);
+            lyxml_free(ctx, child);
             continue;
         }
 
@@ -1248,7 +1251,7 @@
                 LOGVAL(LYE_TOOMANY, LOGLINE(child), child->name, yin->name);
                 goto error;
             }
-            dev->dsc = read_yin_subnode(module->ctx, child, "text");
+            dev->dsc = read_yin_subnode(ctx, child, "text");
             if (!dev->dsc) {
                 goto error;
             }
@@ -1257,7 +1260,7 @@
                 LOGVAL(LYE_TOOMANY, LOGLINE(child), child->name, yin->name);
                 goto error;
             }
-            dev->ref = read_yin_subnode(module->ctx, child, "text");
+            dev->ref = read_yin_subnode(ctx, child, "text");
             if (!dev->ref) {
                 goto error;
             }
@@ -1274,7 +1277,7 @@
             goto error;
         }
 
-        lyxml_free(module->ctx, child);
+        lyxml_free(ctx, child);
     }
 
     if (c_dev) {
@@ -1333,7 +1336,7 @@
         LY_TREE_FOR_SAFE(develem->child, next, child) {
             if (!child->ns || strcmp(child->ns->value, LY_NSYIN)) {
                 /* garbage */
-                lyxml_free(module->ctx, child);
+                lyxml_free(ctx, child);
                 continue;
             }
 
@@ -1388,7 +1391,7 @@
                     goto error;
                 }
                 GETVAL(value, child, "value");
-                d->dflt = lydict_insert(module->ctx, value, 0);
+                d->dflt = lydict_insert(ctx, value, 0);
 
                 if (dev->target->nodetype == LYS_CHOICE) {
                     choice = (struct lys_node_choice *)dev->target;
@@ -1441,14 +1444,14 @@
                             goto error;
                         }
                         /* remove value */
-                        lydict_remove(leaf->module->ctx, leaf->dflt);
+                        lydict_remove(ctx, leaf->dflt);
                         leaf->dflt = NULL;
                     } else { /* add (already checked) and replace */
                         /* remove value */
-                        lydict_remove(leaf->module->ctx, leaf->dflt);
+                        lydict_remove(ctx, leaf->dflt);
 
                         /* set new value */
-                        leaf->dflt = lydict_insert(leaf->module->ctx, d->dflt, 0);
+                        leaf->dflt = lydict_insert(ctx, d->dflt, 0);
                     }
                 } else {
                     /* invalid target for default value */
@@ -1558,7 +1561,7 @@
 
                 /* replace */
                 /* remove current units value of the target ... */
-                lys_type_free(dev->target->module->ctx, t);
+                lys_type_free(ctx, t);
 
                 /* ... and replace it with the value specified in deviation */
                 /* HACK for unres */
@@ -1590,7 +1593,7 @@
 
                 /* get units value */
                 GETVAL(value, child, "name");
-                d->units = lydict_insert(module->ctx, value, 0);
+                d->units = lydict_insert(ctx, value, 0);
 
                 /* apply to target */
                 if (d->mod == LY_DEVIATE_ADD) {
@@ -1610,13 +1613,13 @@
                         goto error;
                     }
                     /* remove current units value of the target */
-                    lydict_remove(dev->target->module->ctx, *stritem);
+                    lydict_remove(ctx, *stritem);
                 } else { /* add (already checked) and replace */
                     /* remove current units value of the target ... */
-                    lydict_remove(dev->target->module->ctx, *stritem);
+                    lydict_remove(ctx, *stritem);
 
                     /* ... and replace it with the value specified in deviation */
-                    *stritem = lydict_insert(module->ctx, value, 0);
+                    *stritem = lydict_insert(ctx, value, 0);
                 }
             } else {
                 LOGVAL(LYE_INSTMT, LOGLINE(child), child->name);
@@ -1664,7 +1667,7 @@
                 }
 
                 for (i = 0; i < list->must_size; i++) {
-                    lys_restr_free(dev->target->module->ctx, &(*trg_must[i]));
+                    lys_restr_free(ctx, &(*trg_must[i]));
                 }
                 free(*trg_must);
                 *trg_must = d->must = calloc(c_must, sizeof *d->must);
@@ -1673,6 +1676,10 @@
             } else if (d->mod == LY_DEVIATE_ADD) {
                 /* reallocate the must array of the target */
                 d->must = ly_realloc(*trg_must, (c_must + *trg_must_size) * sizeof *d->must);
+                if (!d->must) {
+                    LOGMEM;
+                    goto error;
+                }
                 *trg_must = d->must;
                 d->must = &((*trg_must)[*trg_must_size]);
                 d->must_size = c_must;
@@ -1703,7 +1710,7 @@
 
                 for (i = 0; i < list->unique_size; i++) {
                     for (j = 0; j < list->unique[i].expr_size; j++) {
-                        lydict_remove(list->module->ctx, list->unique[i].expr[j]);
+                        lydict_remove(ctx, list->unique[i].expr[j]);
                     }
                     free(list->unique[i].expr);
                 }
@@ -1738,7 +1745,7 @@
                     for (i = 0; i < *trg_must_size; i++) {
                         if (d->must[d->must_size].expr == (*trg_must)[i].expr) {
                             /* we have a match, free the must structure ... */
-                            lys_restr_free(dev->target->module->ctx, &((*trg_must)[i]));
+                            lys_restr_free(ctx, &((*trg_must)[i]));
                             /* ... and maintain the array */
                             (*trg_must_size)--;
                             if (i != *trg_must_size) {
@@ -1798,7 +1805,7 @@
                         if (j == d->unique[d->unique_size].expr_size) {
                             /* we have a match, free the unique structure ... */
                             for (j = 0; j < list->unique[i].expr_size; j++) {
-                                lydict_remove(list->module->ctx, list->unique[i].expr[j]);
+                                lydict_remove(ctx, list->unique[i].expr[j]);
                             }
                             free(list->unique[i].expr);
                             /* ... and maintain the array */
