Does not release path got from IRI.
[cascardo/atompub.git] / atom / entry.c
index c1385d1..02f7be5 100644 (file)
@@ -31,8 +31,7 @@ Atom *
 atom_new_data_len (char *data, size_t len)
 {
   Atom *atom = g_slice_new (Atom);
-  atom->data = g_malloc (len);
-  memcpy (atom->data, data, len);
+  atom->data = g_memdup (data, len);
   atom->len = len;
   return atom;
 }
@@ -40,8 +39,6 @@ atom_new_data_len (char *data, size_t len)
 void
 atom_delete (Atom *atom)
 {
-  if (atom->data)
-    g_free (atom->data);
   g_slice_free (Atom, atom);
 }