File: 1000_fix_missing_g_strdup.patch

package info (click to toggle)
python-caja 1.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 832 kB
  • sloc: xml: 1,745; ansic: 791; python: 297; makefile: 182; sh: 19
file content (31 lines) | stat: -rw-r--r-- 947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/src/caja-python.c b/src/caja-python.c
index 60841b6..e516ff8 100644
--- a/src/caja-python.c
+++ b/src/caja-python.c
@@ -107,7 +107,7 @@ caja_python_load_file(GTypeModule *type_module,
 	}
 
 	main_locals = PyModule_GetDict(main_module);
-	module = PyImport_ImportModuleEx((char *) filename, main_locals, main_locals, NULL);
+	module = PyImport_ImportModuleEx(filename, main_locals, main_locals, NULL);
 	if (!module)
 	{
 		PyErr_Print();
@@ -130,7 +130,7 @@ caja_python_load_file(GTypeModule *type_module,
 			gtype = caja_python_object_get_type(type_module, value);
 			g_array_append_val(all_types, gtype);
 
-			all_pyfiles = g_list_append(all_pyfiles, (gchar*)filename);
+			all_pyfiles = g_list_append(all_pyfiles, g_strdup(filename));
 		}
 	}
 
@@ -336,7 +336,7 @@ caja_module_shutdown(void)
 		Py_Finalize();
 
 	g_array_free(all_types, TRUE);
-	g_list_free (all_pyfiles);
+	g_list_free_full(all_pyfiles, g_free);
 }
 
 void