mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 08:22:16 +01:00 
			
		
		
		
	dup the new value before freeing the old, just in case. (#172142, Morten
2005-05-20 Matthias Clasen <mclasen@redhat.com> * gvaluetypes.c (g_value_set_string): dup the new value before freeing the old, just in case. (#172142, Morten Welinder)
This commit is contained in:
		
				
					committed by
					
						 Matthias Clasen
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							19c6921798
						
					
				
				
					commit
					b5c20b801c
				
			| @@ -1,3 +1,9 @@ | |||||||
|  | 2005-05-20  Matthias Clasen  <mclasen@redhat.com> | ||||||
|  |  | ||||||
|  | 	* gvaluetypes.c (g_value_set_string): dup the new value | ||||||
|  | 	before freeing the old, just in case.  (#172142, Morten | ||||||
|  | 	Welinder) | ||||||
|  |  | ||||||
| 2005-05-13  Matthias Clasen  <mclasen@redhat.com> | 2005-05-13  Matthias Clasen  <mclasen@redhat.com> | ||||||
|  |  | ||||||
| 	* glib-genmarshal.1: Mention 64bit integer types. | 	* glib-genmarshal.1: Mention 64bit integer types. | ||||||
|   | |||||||
| @@ -739,13 +739,18 @@ void | |||||||
| g_value_set_string (GValue	*value, | g_value_set_string (GValue	*value, | ||||||
| 		    const gchar *v_string) | 		    const gchar *v_string) | ||||||
| { | { | ||||||
|  |   gchar *new_val; | ||||||
|  |  | ||||||
|   g_return_if_fail (G_VALUE_HOLDS_STRING (value)); |   g_return_if_fail (G_VALUE_HOLDS_STRING (value)); | ||||||
|  |  | ||||||
|  |   new_val = g_strdup (v_string); | ||||||
|  |  | ||||||
|   if (value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS) |   if (value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS) | ||||||
|     value->data[1].v_uint = 0; |     value->data[1].v_uint = 0; | ||||||
|   else |   else | ||||||
|     g_free (value->data[0].v_pointer); |     g_free (value->data[0].v_pointer); | ||||||
|   value->data[0].v_pointer = g_strdup (v_string); |  | ||||||
|  |   value->data[0].v_pointer = new_val; | ||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user