lttv: don't crash on empty trace
[lttv.git] / ltt / branches / poly / lttv / lttv / tracecontext.c
index 5f08d78c8ba214297e7863dfd2fd82de95ffe7d7..f5b78b5cbfdd8d640fe6b91576b68d415c840010 100644 (file)
@@ -1038,7 +1038,8 @@ void lttv_trace_hook_remove_all(GArray **th)
   for(i=0; i<(*th)->len; i++) {
     g_ptr_array_free(g_array_index(*th, LttvTraceHook, i).fields, TRUE);
   }
-  *th = g_array_remove_range(*th, 0, (*th)->len);
+  if((*th)->len)
+    *th = g_array_remove_range(*th, 0, (*th)->len);
 }
 
 LttvTracesetContextPosition *lttv_traceset_context_position_new(
This page took 0.023066 seconds and 4 git commands to generate.