diff --git a/gtksourceview/gtksourceundomanagerdefault.c b/gtksourceview/gtksourceundomanagerdefault.c
index 97bf632..8c988eb 100644
--- a/gtksourceview/gtksourceundomanagerdefault.c
+++ b/gtksourceview/gtksourceundomanagerdefault.c
@@ -791,8 +791,10 @@ gtk_source_undo_action_free (GtkSourceUndoAction *action)
 		g_free (action->action.insert.text);
 	else if (action->action_type == GTK_SOURCE_UNDO_ACTION_DELETE)
 		g_free (action->action.delete.text);
-	else
+	else {
+		g_free (action);
 		g_return_if_reached ();
+	}
 
 	g_free (action);
 }
