Blob Blame History Raw
diff -up ghostscript-9.07/base/gsicc_manage.c.icc-missing-check ghostscript-9.07/base/gsicc_manage.c
--- ghostscript-9.07/base/gsicc_manage.c.icc-missing-check	2013-02-14 07:58:13.000000000 +0000
+++ ghostscript-9.07/base/gsicc_manage.c	2013-02-14 17:15:48.974654828 +0000
@@ -144,6 +144,8 @@ gsicc_set_iccsmaskprofile(const char *pn
     if (str != NULL) {
         icc_profile = gsicc_profile_new(str, mem, pname, namelen);
         code = sfclose(str);
+    }
+    if (str != NULL && icc_profile != NULL) {
         /* Get the profile handle */
         icc_profile->profile_handle =
             gsicc_get_profile_handle_buffer(icc_profile->buffer,
@@ -593,6 +595,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t
                             icc_profile =
                                 gsicc_profile_new(str, mem, curr_ptr, strlen(curr_ptr));
                             code = sfclose(str);
+                        }
+                        if (str != NULL && icc_profile != NULL) {
                             gsicc_init_profile_info(icc_profile);
                             cmm = gsCMM_DEFAULT;
                             /* Check if this object is a devicelink profile. 
@@ -1516,6 +1520,8 @@ gsicc_set_device_profile(gx_device * pde
             icc_profile =
                 gsicc_profile_new(str, mem, file_name, strlen(file_name));
             code = sfclose(str);
+        }
+        if (str != NULL && icc_profile != NULL) {
             if (pro_enum < gsPROOFPROFILE) {
                 if_debug1m(gs_debug_flag_icc, mem,
                            "[icc] Setting device profile %d\n", pro_enum);