[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: x_image.c



  User: cnieves 
  Date: 07/02/23 14:17:03

  Modified:    .        x_image.c
  Log:
  In case of error, free the GError after using it, and don't unlink the file.
  
  * src/x_image.c: Free the GError after using it, and don't unlink
  
    the image file in case of errors. It's not always safe. 
  
    For example: if the operation was not allowed due to permissions, 
  
    the _previous existing_ file will be removed.
  
  
  
  
  Revision  Changes    Path
  1.33      +8 -1      eda/geda/gaf/gschem/src/x_image.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_image.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_image.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -b -r1.32 -r1.33
  --- x_image.c	22 Feb 2007 17:18:29 -0000	1.32
  +++ x_image.c	23 Feb 2007 19:17:03 -0000	1.33
  @@ -376,8 +376,15 @@
         gtk_dialog_run (GTK_DIALOG (dialog));
         gtk_widget_destroy (dialog);
   
  +      /* Free the gerror */
  +      g_error_free(gerror); 
  +      gerror = NULL;
  +
         /* Unlink the output file */
  -      unlink(filename);
  +      /* It's not safe to unlink the file if there was an error.
  +	 For example: if the operation was not allowed due to permissions, 
  +	 the _previous existing_ file will be removed */
  +      /* unlink(filename); */
       }
       else {
         if (w_current->image_color == TRUE) {
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs