Merged changes in the trunk up to revision 26719.
[blender-staging.git] / source / blender / python / intern / bpy_interface.c
index 8437f4d376e1423675056394d689cf44fab63edf..c02ddf34aabbcb90b343026dfbaab4ca274137c0 100644 (file)
@@ -455,11 +455,11 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
 
                        fclose(fp);
 
-                       pystring= malloc(strlen(fn) + 32);
+                       pystring= MEM_mallocN(strlen(fn) + 32, "pystring");
                        pystring[0]= '\0';
                        sprintf(pystring, "exec(open(r'%s').read())", fn);
                        py_result = PyRun_String( pystring, Py_file_input, py_dict, py_dict );
-                       free(pystring);
+                       MEM_freeN(pystring);
 #else
                        py_result = PyRun_File(fp, fn, Py_file_input, py_dict, py_dict);
                        fclose(fp);