monitor: distops: add missing free + assert in retrieve.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Wed, 5 Aug 2015 13:50:56 +0000 (15:50 +0200)
committerDavid Cock <david.cock@inf.ethz.ch>
Tue, 11 Aug 2015 09:19:39 +0000 (11:19 +0200)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

usr/monitor/capops/revoke.c

index c6650a0..7236e60 100644 (file)
@@ -134,6 +134,7 @@ revoke_result__rx(errval_t result,
     }
 
     st->result_handler(result, st->st);
+    free(st);
 }
 
 static void
@@ -145,6 +146,12 @@ revoke_retrieve__rx(errval_t result, void *st_)
         revoke_result__rx(result, st, false);
     }
     else {
+#ifndef NDEBUG
+        distcap_state_t state;
+        errval_t err = dom_cnode_get_state(st->cap, &state);
+        PANIC_IF_ERR(err, "dom_cnode_get_state");
+        assert(!distcap_state_is_foreign(state));
+#endif
         revoke_local(st);
     }
 }