ralloc: Allow reparenting to a NULL context

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index 9cce9e0..42cfa2e 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -285,7 +285,7 @@
       return;
 
    info = get_header(ptr);
-   parent = get_header(new_ctx);
+   parent = new_ctx ? get_header(new_ctx) : NULL;
 
    unlink_block(info);