Fix Coverity errors (incl. serious crashers), rework sock being global static for...
[claws.git] / src / plugins / clamd / clamav_plugin_gtk.c
index f01555a0352db02fc66a1406d0de30c7c085ee60..231d378c5ef4b276dfb33b10629651a4cc973970 100644 (file)
@@ -106,7 +106,8 @@ static void clamd_folder_cb(GtkWidget *widget, gpointer data)
 static void check_permission(gchar* folder) {
        struct stat info;
 
-       g_stat(folder, &info);
+       if (g_stat(folder, &info) < 0)
+               return;
        mode_t perm = info.st_mode & ~(S_IFMT);
        debug_print("%s: Old file permission: %05o\n", folder, perm);
        if ((perm & S_IXOTH) != S_IXOTH) {