-        vfs_path_t *vpath = vfs_path_from_str (path);
+        vfs_path_t *vpath;

+        vpath = vfs_path_from_str (path);
         p = smbfs_get_path (&sc, vpath);
         vfs_path_free (vpath);

-        g_free (p);
-        if (p)
+        if (p != NULL)
         {
             memset (buf, 0, sizeof (*buf));
             /*      show this as dir        */
             buf->st_mode =
                 (S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR |
S_IXGRP | S_IXOTH) & myumask;
+            g_free (p);
             return 0;
         }
+        g_free (p);
         return -1;



There was no bug.

"free(p); if (p) ..." is a valid code, since it doesn't access memory
pointed to by p, it only looks at the value of the pointer p.
_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel

Reply via email to