diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 81a0f34..c6b9b5b 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -397,13 +397,12 @@ emit_event (AtkObject  *obj,
             void (*append_variant) (DBusMessageIter *, const char *, const void *))
 {
   DBusConnection *bus = spi_global_app_data->bus;
-  const char *path =  spi_register_object_to_path (spi_global_register,
-                                                   G_OBJECT (obj));
+  char *path;
 
   gchar *cname, *t;
   DBusMessage *sig;
   DBusMessageIter iter, iter_struct;
-  
+
   if (!klass) klass = "";
   if (!major) major = "";
   if (!minor) minor = "";
@@ -412,6 +411,8 @@ emit_event (AtkObject  *obj,
   if (!signal_is_needed (klass, major, minor))
     return;
 
+  path = spi_register_object_to_path (spi_global_register, G_OBJECT (obj));
+
   /*
    * This is very annoying, but as '-' isn't a legal signal
    * name in D-Bus (Why not??!?) The names need converting
@@ -435,6 +436,7 @@ emit_event (AtkObject  *obj,
     spi_object_lease_if_needed (G_OBJECT (obj));
 
   g_free(cname);
+  g_free(path);
 }
 
 /*---------------------------------------------------------------------------*/
