Index: src/lib/elm_cnp_helper.c
===================================================================
--- src/lib/elm_cnp_helper.c	(revision 63087)
+++ src/lib/elm_cnp_helper.c	(working copy)
@@ -772,7 +772,7 @@
 {
    Ecore_X_Selection_Data *data;
    Ecore_X_Selection_Data_Files *files;
-   char *p;
+   char *p, *stripstr;
 
    data = notify->data;
    cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
@@ -786,11 +786,11 @@
              cnp_debug("more then one file: Bailing\n");
              return 0;
           }
-        p = files->files[0];
+        stripstr = p = strdup(files->files[0]);
      }
    else
      {
-        p = (char *)data->data;
+        stripstr = p = strndup((char *)data->data, data->length);
      }
 
    if (!p)
@@ -802,7 +802,11 @@
    if (strncmp(p, "file://", 7))
      {
         /* Try and continue if it looks sane */
-        if (*p != '/') return 0;
+        if (*p != '/')
+          {
+             free(p);
+             return 0;
+          }
      }
    else
      {
@@ -819,6 +823,7 @@
      {
         pasteimage_append(p, sel->requestwidget);
      }
+   free(stripstr);
    return 0;
 }
 
