[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: a_basic.c
User: ahvezda
Date: 06/07/15 13:00:52
Modified: . a_basic.c f_basic.c f_print.c g_basic.c g_rc.c
g_smob.c i_vars.c o_arc_basic.c o_attrib.c
o_box_basic.c o_bus_basic.c o_circle_basic.c
o_complex_basic.c o_line_basic.c o_net_basic.c
o_picture.c o_pin_basic.c o_selection.c
o_text_basic.c s_attrib.c s_basic.c s_color.c
s_conn.c s_hierarchy.c s_menu.c s_papersizes.c
s_slib.c s_stretch.c s_tile.c s_undo.c u_basic.c
Log:
Converted all free, ?alloc, and strdup calls to use g_free, g_?alloc,
and g_strdup. This is the first phase in fixing the slice crash under
glib 2.10.x.
Revision Changes Path
1.20 +2 -2 eda/geda/gaf/libgeda/src/a_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: a_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/a_basic.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- a_basic.c 5 Jul 2006 03:13:38 -0000 1.19
+++ a_basic.c 15 Jul 2006 17:00:51 -0000 1.20
@@ -133,7 +133,7 @@
/* output the line */
fprintf(fp, "%s\n", out);
- free(out);
+ g_free(out);
/* save those attributes */
if (o_current->attribs != NULL) {
@@ -266,7 +266,7 @@
/* output the line */
if (!already_wrote) {
fprintf(fp, "%s\n", out);
- free(out);
+ g_free(out);
} else {
already_wrote=0;
}
1.19 +4 -4 eda/geda/gaf/libgeda/src/f_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: f_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/f_basic.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- f_basic.c 5 Jul 2006 03:13:38 -0000 1.18
+++ f_basic.c 15 Jul 2006 17:00:51 -0000 1.19
@@ -88,7 +88,7 @@
/* write full, absolute filename into page_current->page_filename */
if (w_current->page_current->page_filename) {
- free(w_current->page_current->page_filename);
+ g_free(w_current->page_current->page_filename);
}
w_current->page_current->page_filename = g_strdup(full_filename);
@@ -212,8 +212,8 @@
w_current->page_current->CHANGED=1;
}
- free(full_filename);
- free(full_rcfilename);
+ g_free(full_filename);
+ g_free(full_rcfilename);
/* If this was a preview window, reset the directory to the
* value it had when f_open was called. Also get rid of component
@@ -221,7 +221,7 @@
* is actually selected, they will be re-read later. */
if (w_current->wid == -1) {
chdir(saved_cwd);
- free(saved_cwd);
+ g_free(saved_cwd);
}
if (!opened) {
1.24 +5 -5 eda/geda/gaf/libgeda/src/f_print.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: f_print.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/f_print.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- f_print.c 5 Jul 2006 03:13:38 -0000 1.23
+++ f_print.c 15 Jul 2006 17:00:51 -0000 1.24
@@ -136,7 +136,7 @@
/* Allocate a buffer to use during copy */
#define PROLOG_BUFFER_SIZE 8192
- buf = malloc(PROLOG_BUFFER_SIZE);
+ buf = g_malloc(PROLOG_BUFFER_SIZE);
if(buf == NULL) {
s_log_message("Unable to allocate %d bytes in f_print_header()\n"
"Giving up on printing.\n",PROLOG_BUFFER_SIZE);
@@ -148,7 +148,7 @@
s_log_message("Unable to open the prolog file `%s' for reading "
"in f_print_header()\n"
"Giving up on printing\n", w_current->postscript_prolog);
- free(buf); /* If we got to here, the buffer was allocated. */
+ g_free(buf); /* If we got to here, the buffer was allocated. */
return 0;
}
/* Loop while reading file into buffer and dump it
@@ -164,7 +164,7 @@
s_log_message("Error during reading of the prolog file `%s' "
"in f_print_header()\n"
"Giving up on printing\n", w_current->postscript_prolog);
- free(buf); /* If we got to here, the buffer was allocated. */
+ g_free(buf); /* If we got to here, the buffer was allocated. */
return 0;
}
@@ -172,10 +172,10 @@
s_log_message("Error during writing of the output postscript file "
"in f_print_header()\n"
"Giving up on printing\n");
- free(buf); /* If we got to here, the buffer was allocated. */
+ g_free(buf); /* If we got to here, the buffer was allocated. */
return 0;
}
- free(buf); /* If we got to here, the buffer was allocated. */
+ g_free(buf); /* If we got to here, the buffer was allocated. */
fprintf(fp,"%%%%EndProlog\n"
"%%%%Page: 1 1\n"); /* Just name it `page 1' for now */
1.12 +1 -1 eda/geda/gaf/libgeda/src/g_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/g_basic.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- g_basic.c 5 Jul 2006 03:13:38 -0000 1.11
+++ g_basic.c 15 Jul 2006 17:00:51 -0000 1.12
@@ -180,7 +180,7 @@
scm_close_port(port);
- free(full_filename);
+ g_free(full_filename);
return (eval_result == SCM_BOOL_T);
}
1.2 +45 -45 eda/geda/gaf/libgeda/src/g_rc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_rc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/g_rc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- g_rc.c 5 Jul 2006 03:13:38 -0000 1.1
+++ g_rc.c 15 Jul 2006 17:00:51 -0000 1.2
@@ -160,10 +160,10 @@
rcname);
found_rc = g_rc_parse_general(w_current, filename, ok_msg, err_msg);
- g_free (ok_msg);
- g_free (err_msg);
- g_free (tmp);
- free(filename);
+ g_free(ok_msg);
+ g_free(err_msg);
+ g_free(tmp);
+ g_free(filename);
return found_rc;
}
@@ -205,10 +205,10 @@
rcname);
found_rc = g_rc_parse_general(w_current, filename, ok_msg, err_msg);
- g_free (ok_msg);
- g_free (err_msg);
- g_free (tmp);
- free(filename);
+ g_free(ok_msg);
+ g_free(err_msg);
+ g_free(tmp);
+ g_free(filename);
return found_rc;
}
@@ -241,10 +241,10 @@
rcname);
found_rc = g_rc_parse_general(w_current, filename, ok_msg, err_msg);
- g_free (ok_msg);
- g_free (err_msg);
- g_free (tmp);
- free(filename);
+ g_free(ok_msg);
+ g_free(err_msg);
+ g_free(tmp);
+ g_free(filename);
return found_rc;
}
@@ -278,7 +278,7 @@
g_free(ok_msg);
g_free(err_msg);
- free(filename);
+ g_free(filename);
return found_rc;
}
@@ -310,7 +310,7 @@
/* g_setenv ("GEDADATARC", rc_path, TRUE); */ /*requires glib 2.4.x*/
geda_rcdata = g_strdup_printf("GEDADATARC=%s", rc_path);
putenv(geda_rcdata);
- free (rc_path);
+ g_free(rc_path);
/* visit rc files in order */
/* Changed by SDB 1.2.2005 in response to Peter Kaiser's bug report.
@@ -360,7 +360,7 @@
fprintf(stderr,
"Invalid path [%s] passed to component-library\n",
string);
- free (string);
+ g_free(string);
return SCM_BOOL_F;
}
@@ -374,12 +374,12 @@
#endif
temp = g_strconcat (cwd, G_DIR_SEPARATOR_S, string, NULL);
s_clib_add_directory (temp);
- g_free (temp);
- g_free (cwd);
+ g_free(temp);
+ g_free(cwd);
}
if (string) {
- free(string);
+ g_free(string);
}
return SCM_BOOL_T;
@@ -410,7 +410,7 @@
fprintf (stderr,
"Invalid path [%s] passed to component-library-search\n",
string);
- free (string);
+ g_free(string);
return SCM_BOOL_F;
}
@@ -419,7 +419,7 @@
fprintf (stderr,
"Invalid path [%s] passed to component-library-search\n",
string);
- free (string);
+ g_free(string);
return SCM_BOOL_F;
}
@@ -448,16 +448,16 @@
fullpath,
NULL);
s_clib_add_directory (temp);
- g_free (temp);
- g_free (cwd);
+ g_free(temp);
+ g_free(cwd);
}
}
- g_free (fullpath);
+ g_free(fullpath);
}
}
if (string) {
- free(string);
+ g_free(string);
}
return SCM_BOOL_T;
@@ -486,7 +486,7 @@
fprintf (stderr,
"Invalid path [%s] passed to source-library\n",
string);
- free (string);
+ g_free(string);
return SCM_BOOL_F;
}
@@ -503,12 +503,12 @@
string,
NULL);
s_slib_add_entry (temp);
- g_free (temp);
- g_free (cwd);
+ g_free(temp);
+ g_free(cwd);
}
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_T;
@@ -539,7 +539,7 @@
fprintf (stderr,
"Invalid path [%s] passed to source-library-search\n",
string);
- free (string);
+ g_free(string);
return SCM_BOOL_F;
}
@@ -549,7 +549,7 @@
"Invalid path [%s] passed to source-library-search\n",
string);
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_F;
}
@@ -580,17 +580,17 @@
fullpath,
NULL);
s_slib_add_entry (temp);
- g_free (temp);
- g_free (cwd);
+ g_free(temp);
+ g_free(cwd);
}
}
}
- g_free (fullpath);
+ g_free(fullpath);
}
}
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_T;
@@ -651,7 +651,7 @@
SCM_ARG1, "default-series-name");
if (default_series_name) {
- free (default_series_name);
+ g_free(default_series_name);
}
default_series_name = g_strdup (SCM_STRING_CHARS (name));
@@ -672,7 +672,7 @@
SCM_ARG1, "untitled-name");
if (default_untitled_name) {
- free (default_untitled_name);
+ g_free(default_untitled_name);
}
default_untitled_name = g_strdup (SCM_STRING_CHARS (name));
@@ -704,13 +704,13 @@
"Invalid path [%s] passed to font-directory\n",
string);
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_F;
}
if (default_font_directory) {
- free (default_font_directory);
+ g_free(default_font_directory);
}
default_font_directory = string;
@@ -741,13 +741,13 @@
"Invalid path [%s] passed to scheme-directory\n",
string);
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_F;
}
if (default_scheme_directory) {
- free (default_scheme_directory);
+ g_free(default_scheme_directory);
}
default_scheme_directory = string;
@@ -778,13 +778,13 @@
"Invalid path [%s] passed to bitmap-directory\n",
string);
if (string) {
- free (string);
+ g_free(string);
}
return SCM_BOOL_F;
}
if (default_bitmap_directory) {
- free (default_bitmap_directory);
+ g_free(default_bitmap_directory);
}
default_bitmap_directory = string;
@@ -804,7 +804,7 @@
SCM_ARG1, "bus-ripper-symname");
if (default_bus_ripper_symname) {
- free (default_bus_ripper_symname);
+ g_free(default_bus_ripper_symname);
}
default_bus_ripper_symname = g_strdup (SCM_STRING_CHARS (scmsymname));
@@ -826,7 +826,7 @@
SCM_ARG1, "postsript-prolog");
if (default_postscript_prolog) {
- free (default_postscript_prolog);
+ g_free(default_postscript_prolog);
}
string = g_strdup (SCM_STRING_CHARS (scmsymname));
@@ -920,7 +920,7 @@
SCM_ARG1, "always-promote-attributes");
if (default_always_promote_attributes) {
- free (default_always_promote_attributes);
+ g_free(default_always_promote_attributes);
}
default_always_promote_attributes =
g_strdup_printf(" %s ", SCM_STRING_CHARS (scmsymname));
1.7 +6 -6 eda/geda/gaf/libgeda/src/g_smob.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_smob.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/g_smob.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- g_smob.c 5 Jul 2006 03:13:38 -0000 1.6
+++ g_smob.c 15 Jul 2006 17:00:51 -0000 1.7
@@ -53,7 +53,7 @@
(struct st_attrib_smob *)SCM_CDR(attrib_smob);
scm_sizet size = sizeof(struct st_attrib_smob);
- free(attribute);
+ free(attribute); /* this should stay as free (allocated from guile) */
return size;
}
@@ -141,8 +141,8 @@
&name, &value );
returned = scm_cons (scm_makfrom0str (name),
scm_makfrom0str (value));
- if (name) free(name);
- if (value) free(value);
+ if (name) g_free(name);
+ if (value) g_free(value);
}
return returned;
@@ -194,8 +194,8 @@
*world = attribute->world;
*o_attrib = attribute->attribute->object;
- if (name) free(name);
- if (old_value) free(old_value);
+ if (name) g_free(name);
+ if (old_value) g_free(old_value);
}
return SCM_UNDEFINED;
@@ -234,7 +234,7 @@
(struct st_object_smob *)SCM_CDR(object_smob);
scm_sizet size = sizeof(struct st_object_smob);
- free(object);
+ free(object); /* this should stay as free (allocated from guile) */
return size;
}
1.2 +9 -9 eda/geda/gaf/libgeda/src/i_vars.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: i_vars.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/i_vars.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- i_vars.c 5 Jul 2006 03:13:38 -0000 1.1
+++ i_vars.c 15 Jul 2006 17:00:51 -0000 1.2
@@ -39,7 +39,7 @@
/*! \def INIT_STR(w, name, str) */
#define INIT_STR(w, name, str) { \
if ((w)->name) { \
- free((w)->name); \
+ g_free((w)->name); \
} \
(w)->name = g_strdup(((default_ ## name) != NULL) ? \
(default_ ## name) : (str)); \
@@ -120,12 +120,12 @@
*/
void i_vars_freenames()
{
- free(default_series_name);
- free(default_untitled_name);
- free(default_font_directory);
- free(default_scheme_directory);
- free(default_bitmap_directory);
- free(default_bus_ripper_symname);
- free(default_postscript_prolog);
- free(default_always_promote_attributes);
+ g_free(default_series_name);
+ g_free(default_untitled_name);
+ g_free(default_font_directory);
+ g_free(default_scheme_directory);
+ g_free(default_bitmap_directory);
+ g_free(default_bus_ripper_symname);
+ g_free(default_postscript_prolog);
+ g_free(default_always_promote_attributes);
}
1.28 +1 -1 eda/geda/gaf/libgeda/src/o_arc_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_arc_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_arc_basic.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- o_arc_basic.c 5 Jul 2006 03:13:38 -0000 1.27
+++ o_arc_basic.c 15 Jul 2006 17:00:51 -0000 1.28
@@ -83,7 +83,7 @@
new_node->type = type;
new_node->color = color;
- new_node->arc = (ARC *) malloc(sizeof(ARC));
+ new_node->arc = (ARC *) g_malloc(sizeof(ARC));
/*! \note
* The ARC structure is initialized with the parameters.
1.36 +100 -109 eda/geda/gaf/libgeda/src/o_attrib.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_attrib.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_attrib.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- o_attrib.c 5 Jul 2006 03:13:38 -0000 1.35
+++ o_attrib.c 15 Jul 2006 17:00:51 -0000 1.36
@@ -80,7 +80,7 @@
return;
len=strlen(o_current->text->string);
- uref=malloc(len+10);
+ uref=g_malloc(len+10);
strcpy(uref,o_current->text->string);
while (o_current->text->string[len-1]<='9' &&
@@ -93,7 +93,7 @@
++index_list_len;
}
- index_list=calloc(index_list_len,1);
+ index_list=calloc(index_list_len,1); /* convert to g_new maybe... */
name_conflict=0;
for (obj=list_head->next;obj;obj=obj->next) {
@@ -112,12 +112,12 @@
if (name_conflict) {
for (i=0;index_list[i];++i);
sprintf(uref+len,"%d", i);
- free(o_current->text->string);
+ g_free(o_current->text->string);
o_current->text->string=uref;
o_text_recreate(w_current, o_current);
}
- free(index_list);
+ g_free(index_list);
}
/*! \brief Search for an item in an attribute list.
@@ -184,7 +184,7 @@
{
ATTRIB *head = NULL;
- head = (ATTRIB *) malloc(sizeof(ATTRIB));
+ head = (ATTRIB *) g_malloc(sizeof(ATTRIB));
head->next = NULL;
/* highly experimental hack */
@@ -220,7 +220,7 @@
end = o_attrib_return_tail(list_head);
/* create an new st_attrib object */
- new = (ATTRIB *) malloc(sizeof(ATTRIB));
+ new = (ATTRIB *) g_malloc(sizeof(ATTRIB));
/* fill item with correct data (mainly item) */
new->next = NULL;
@@ -297,7 +297,7 @@
/* \todo were do we detach the object->attached_to? above */
current->object=NULL;
- free(current);
+ g_free(current);
}
}
@@ -580,7 +580,7 @@
}
a_current->object = NULL;
- free(a_current);
+ g_free(a_current);
}
}
@@ -863,7 +863,7 @@
}
/* output the line */
fprintf(fp, "%s\n", out);
- free(out);
+ g_free(out);
}
a_current = a_current->next;
}
@@ -965,8 +965,8 @@
/* no = found */
if (!attribute_found) {
- free(*name_ptr); *name_ptr = NULL;
- free(*value_ptr); *value_ptr = NULL;
+ g_free(*name_ptr); *name_ptr = NULL;
+ g_free(*value_ptr); *value_ptr = NULL;
return(FALSE);
}
@@ -987,8 +987,8 @@
if (*value_ptr && (*value_ptr)[0] == '\0') {
s_log_message("Found an improper attribute: _%s_\n", string);
#if 0 /* for now leak this memory till this is verified correct everywhere */
- free(*name_ptr); *name_ptr = NULL;
- free(*value_ptr); *value_ptr = NULL;
+ g_free(*name_ptr); *name_ptr = NULL;
+ g_free(*value_ptr); *value_ptr = NULL;
#endif
return(FALSE);
} else {
@@ -1006,7 +1006,7 @@
void o_attrib_free_current(TOPLEVEL *w_current)
{
if (w_current->current_attribute) {
- free(w_current->current_attribute);
+ g_free(w_current->current_attribute);
}
w_current->current_attribute=NULL;
}
@@ -1064,14 +1064,13 @@
}
if (w_current->current_attribute != NULL) {
- free(w_current->current_attribute);
+ g_free(w_current->current_attribute);
w_current->current_attribute=NULL;
}
len = strlen(string);
- w_current->current_attribute = (char *)
- malloc(sizeof(char)*len+1);
+ w_current->current_attribute = (char *) g_malloc(sizeof(char)*len+1);
strcpy(w_current->current_attribute,string);
@@ -1126,7 +1125,7 @@
while (a_current != NULL) {
- a_new = (ATTRIB *) malloc(sizeof(ATTRIB));
+ a_new = (ATTRIB *) g_malloc(sizeof(ATTRIB));
/* in the case of the head attrib node, object points to
* the parent which the attributes are attached to */
@@ -1298,15 +1297,15 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(sizeof(char)*strlen(found_value)+1);
+ g_malloc(sizeof(char)*strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
#if DEBUG
@@ -1323,8 +1322,8 @@
/* search for attributes outside */
if (o_current->type == OBJ_TEXT) {
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
val = o_attrib_get_name_value(o_current->text->string,
&found_name, &found_value);
if (val) {
@@ -1333,25 +1332,23 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(
- sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
o_current=o_current->next;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1446,16 +1443,16 @@
&found_name, &found_value);
if (val) {
return_string = g_strdup(found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
}
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1539,14 +1536,14 @@
internal_counter++;
} else {
if (strstr(found_name, name)) {
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(found);
}
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
@@ -1554,8 +1551,8 @@
a_current=a_current->next;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1604,24 +1601,23 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
}
a_current=a_current->next;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1667,24 +1663,23 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
o_current=o_current->next;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1764,18 +1759,17 @@
if (val) {
if (strcmp(name, found_name) == 0) {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
if (return_found) {
*return_found = found;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
#if DEBUG
@@ -1791,26 +1785,25 @@
/* search for attributes outside */
if (o_current->type == OBJ_TEXT) {
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
val = o_attrib_get_name_value(o_current->text->string,
&found_name, &found_value);
if (val) {
if (strcmp(name, found_name) == 0) {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
if (return_found) {
*return_found = found;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
@@ -1818,8 +1811,8 @@
*return_found = NULL;
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -1873,16 +1866,15 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
#if DEBUG
@@ -1899,8 +1891,8 @@
/* search for attributes outside */
if (o_current->type == OBJ_TEXT) {
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
val = o_attrib_get_name_value(o_current->text->string,
&found_name, &found_value);
@@ -1910,21 +1902,20 @@
internal_counter++;
} else {
return_string = (char *)
- malloc(sizeof(char)*
- strlen(found_value)+1);
+ g_malloc(sizeof(char)* strlen(found_value)+1);
strcpy(return_string, found_value);
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return(return_string);
}
}
- if (found_name) { free(found_name); found_name = NULL; }
- if (found_value) { free(found_value); found_value = NULL; }
+ if (found_name) { g_free(found_name); found_name = NULL; }
+ if (found_value) { g_free(found_value); found_value = NULL; }
}
}
- if (found_name) free(found_name);
- if (found_value) free(found_value);
+ if (found_name) g_free(found_name);
+ if (found_value) g_free(found_value);
return (NULL);
}
@@ -2025,11 +2016,11 @@
char *search_for;
/* The 9 is the number of digits plus null */
- search_for = (char *) malloc(sizeof(char)*(strlen("pinseq=")+9));
+ search_for = (char *) g_malloc(sizeof(char)*(strlen("pinseq=")+9));
sprintf(search_for, "pinseq=%d", pin_number);
pinseq_text_object = o_attrib_search_string_list(list, search_for);
- free(search_for);
+ g_free(search_for);
if (pinseq_text_object && pinseq_text_object->attached_to) {
return(o_attrib_return_parent(pinseq_text_object->attached_to));
@@ -2056,7 +2047,7 @@
OBJECT *o_current;
/* The 9 is the number of digits plus null */
- search_for = (char *) malloc(sizeof(char)*(strlen("slotdef=:")+9));
+ search_for = (char *) g_malloc(sizeof(char)*(strlen("slotdef=:")+9));
sprintf(search_for, "slotdef=%d:", slotnumber);
@@ -2068,7 +2059,7 @@
}
o_current = o_current->next;
}
- free(search_for);
+ g_free(search_for);
if (return_value) {
return(return_value);
@@ -2145,7 +2136,7 @@
return;
}
slot = atoi(string);
- free(string);
+ g_free(string);
slotdef = o_attrib_search_slotdef(o_current, slot);
@@ -2187,12 +2178,12 @@
if (string && o_pinnum_object && o_pinnum_object->type == OBJ_TEXT &&
o_pinnum_object->text->string) {
- free(string);
- free(o_pinnum_object->text->string);
+ g_free(string);
+ g_free(o_pinnum_object->text->string);
/* 9 is the size of one number plus null character */
o_pinnum_object->text->string = (char *)
- malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
+ g_malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
/* removed _int from current_pin */
sprintf(o_pinnum_object->text->string, "pinnumber=%s", current_pin);
@@ -2208,7 +2199,7 @@
current_pin = strtok(NULL, DELIMITERS);
}
- free(slotdef);
+ g_free(slotdef);
}
/*! \brief Copy attributes from OBJECT to OBJECT.
@@ -2244,7 +2235,7 @@
return;
}
slot = atoi(string);
- free(string);
+ g_free(string);
slotdef = o_attrib_search_slotdef(o_current, slot);
@@ -2287,12 +2278,12 @@
if (string && o_pinnum_object && o_pinnum_object->type == OBJ_TEXT &&
o_pinnum_object->text->string) {
- free(string);
- free(o_pinnum_object->text->string);
+ g_free(string);
+ g_free(o_pinnum_object->text->string);
/* 9 is the size of one number plus null character */
o_pinnum_object->text->string = (char *)
- malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
+ g_malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
/* removed _int from current_pin */
sprintf(o_pinnum_object->text->string, "pinnumber=%s", current_pin);
@@ -2308,7 +2299,7 @@
current_pin = strtok(NULL, DELIMITERS);
}
- free(slotdef);
+ g_free(slotdef);
}
/*! \brief Get the number of TOPLEVEL attributes in all loaded pages.
@@ -2339,7 +2330,7 @@
while(string) {
printf("inside\n");
ret_value++;
- free(string);
+ g_free(string);
string=NULL;
counter++;
@@ -2436,7 +2427,7 @@
a_current = a_current->next;
}
- found_objects = (OBJECT **) malloc(sizeof(OBJECT *)*(num_attribs+1));
+ found_objects = (OBJECT **) g_malloc(sizeof(OBJECT *)*(num_attribs+1));
/* now actually fill the array of objects */
a_current = object->attribs->next;
@@ -2488,5 +2479,5 @@
i++;
}
- free(found_objects);
+ g_free(found_objects);
}
1.23 +1 -1 eda/geda/gaf/libgeda/src/o_box_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_box_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_box_basic.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- o_box_basic.c 5 Jul 2006 03:13:38 -0000 1.22
+++ o_box_basic.c 15 Jul 2006 17:00:51 -0000 1.23
@@ -104,7 +104,7 @@
new_node->type = type;
new_node->color = color;
- box = (BOX *) malloc(sizeof(BOX));
+ box = (BOX *) g_malloc(sizeof(BOX));
new_node->box = box;
/* describe the box with its upper left and lower right corner */
1.14 +1 -1 eda/geda/gaf/libgeda/src/o_bus_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_bus_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_bus_basic.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- o_bus_basic.c 5 Jul 2006 03:13:38 -0000 1.13
+++ o_bus_basic.c 15 Jul 2006 17:00:51 -0000 1.14
@@ -113,7 +113,7 @@
new_node->type = type;
new_node->color = color;
- new_node->line = (LINE *) malloc(sizeof(LINE));
+ new_node->line = (LINE *) g_malloc(sizeof(LINE));
/* check for null */
new_node->line->x[0] = x1;
1.24 +1 -1 eda/geda/gaf/libgeda/src/o_circle_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_circle_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_circle_basic.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- o_circle_basic.c 5 Jul 2006 03:13:38 -0000 1.23
+++ o_circle_basic.c 15 Jul 2006 17:00:51 -0000 1.24
@@ -100,7 +100,7 @@
new_node->type = type;
new_node->color = color;
- new_node->circle = (CIRCLE *) malloc(sizeof(CIRCLE));
+ new_node->circle = (CIRCLE *) g_malloc(sizeof(CIRCLE));
/* describe the circle with its center and radius */
new_node->circle->center_x = x;
1.25 +17 -17 eda/geda/gaf/libgeda/src/o_complex_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_complex_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_complex_basic.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- o_complex_basic.c 5 Jul 2006 03:13:38 -0000 1.24
+++ o_complex_basic.c 15 Jul 2006 17:00:51 -0000 1.25
@@ -433,15 +433,15 @@
new_node = s_basic_init_object("complex");
new_node->type = type;
- new_node->complex_basename = strdup(basename);
+ new_node->complex_basename = g_strdup(basename);
if (clib)
- new_node->complex_clib = strdup(clib);
+ new_node->complex_clib = g_strdup(clib);
else
new_node->complex_clib = NULL;
new_node->color = color;
- new_node->complex = (COMPLEX *) malloc(sizeof(COMPLEX));
+ new_node->complex = (COMPLEX *) g_malloc(sizeof(COMPLEX));
new_node->complex->angle = angle;
new_node->complex->mirror = mirror;
@@ -530,7 +530,7 @@
y + NOT_FOUND_TEXT_Y, LOWER_LEFT, 0,
not_found_text, 8,
VISIBLE, SHOW_NAME_VALUE);
- free(not_found_text);
+ g_free(not_found_text);
/* figure out where to put the hazard triangle */
world_get_text_bounds(w_current, prim_objs,
@@ -650,7 +650,7 @@
}
}
- free(filename);
+ g_free(filename);
return(object_list);
}
@@ -668,7 +668,7 @@
new_node = s_basic_init_object("complex");
new_node->type = type;
- new_node->complex = (COMPLEX *) malloc(sizeof(COMPLEX));
+ new_node->complex = (COMPLEX *) g_malloc(sizeof(COMPLEX));
new_node->complex->x = x;
new_node->complex->y = y;
WORLDtoSCREEN(w_current, x, y,
@@ -678,9 +678,9 @@
new_node->complex->angle = angle;
new_node->complex->mirror = 0;
- new_node->complex_basename = strdup(basename);
+ new_node->complex_basename = g_strdup(basename);
if (clib)
- new_node->complex_clib = strdup(clib);
+ new_node->complex_clib = g_strdup(clib);
else
new_node->complex_clib = NULL;
@@ -866,18 +866,18 @@
}
if (w_current->internal_basename) {
- free(w_current->internal_basename);
+ g_free(w_current->internal_basename);
}
if (w_current->internal_clib) {
- free(w_current->internal_clib);
+ g_free(w_current->internal_clib);
}
len = strlen(basename);
- w_current->internal_basename = (char *) malloc(sizeof(char)*len+1);
+ w_current->internal_basename = (char *) g_malloc(sizeof(char)*len+1);
len = strlen(clib) + 1;
- w_current->internal_clib = (char *) malloc(sizeof(char)*len+1);
+ w_current->internal_clib = (char *) g_malloc(sizeof(char)*len+1);
strcpy(w_current->internal_basename, basename);
strcpy(w_current->internal_clib, clib);
@@ -890,11 +890,11 @@
void o_complex_free_filename(TOPLEVEL *w_current)
{
if (w_current->internal_basename) {
- free(w_current->internal_basename);
+ g_free(w_current->internal_basename);
}
if (w_current->internal_clib) {
- free(w_current->internal_clib);
+ g_free(w_current->internal_clib);
}
}
@@ -1788,7 +1788,7 @@
/* if inside_value and outside_value match, then symbol versions are okay */
done:
- if (inside) free(inside);
- if (outside) free(outside);
- if (refdes) free(refdes);
+ if (inside) g_free(inside);
+ if (outside) g_free(outside);
+ if (refdes) g_free(refdes);
}
1.23 +1 -1 eda/geda/gaf/libgeda/src/o_line_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_line_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_line_basic.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- o_line_basic.c 5 Jul 2006 03:13:38 -0000 1.22
+++ o_line_basic.c 15 Jul 2006 17:00:51 -0000 1.23
@@ -86,7 +86,7 @@
new_node->type = type;
new_node->color = color;
- new_node->line = (LINE *) malloc(sizeof(LINE));
+ new_node->line = (LINE *) g_malloc(sizeof(LINE));
/* describe the line with its two ends */
new_node->line->x[0] = x1;
1.30 +1 -1 eda/geda/gaf/libgeda/src/o_net_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_net_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_net_basic.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- o_net_basic.c 5 Jul 2006 03:13:38 -0000 1.29
+++ o_net_basic.c 15 Jul 2006 17:00:51 -0000 1.30
@@ -150,7 +150,7 @@
new_node->type = type;
new_node->color = color;
- new_node->line = (LINE *) malloc(sizeof(LINE));
+ new_node->line = (LINE *) g_malloc(sizeof(LINE));
/* check for null */
new_node->line->x[0] = x1;
1.2 +10 -10 eda/geda/gaf/libgeda/src/o_picture.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_picture.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_picture.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- o_picture.c 5 Jul 2006 03:13:38 -0000 1.1
+++ o_picture.c 15 Jul 2006 17:00:51 -0000 1.2
@@ -194,7 +194,7 @@
}
if (pixdata_serialized_data != NULL) {
- free (pixdata_serialized_data);
+ g_free (pixdata_serialized_data);
}
if (encoded_picture != NULL) {
g_string_free (encoded_picture, TRUE);
@@ -216,7 +216,7 @@
fprintf(stderr, "Error loading picture from file: %s.\n", temp_filename);
s_log_message( "Error loading picture from file: %s.\n", temp_filename);
}
- free (temp_filename);
+ g_free (temp_filename);
}
/* create and add the picture to the list */
@@ -228,11 +228,11 @@
x1, y1+height, x1+width, y1,
angle, mirrored, embedded);
if (object_list->picture->filename) {
- free(object_list->picture->filename);
+ g_free(object_list->picture->filename);
}
object_list->picture->filename = g_strdup(filename);
- free (filename);
+ g_free (filename);
return(object_list);
}
@@ -316,10 +316,10 @@
object->picture->filename);
}
if (encoded_picture != NULL) {
- free(encoded_picture);
+ g_free(encoded_picture);
}
if (pixdata_serialized_data != NULL) {
- free(pixdata_serialized_data);
+ g_free(pixdata_serialized_data);
}
return(out);
@@ -345,12 +345,12 @@
}
if (w_current->current_pixbuf != NULL) {
- free(w_current->current_pixbuf);
+ g_free(w_current->current_pixbuf);
w_current->current_pixbuf=NULL;
}
if (w_current->pixbuf_filename != NULL) {
- free(w_current->pixbuf_filename);
+ g_free(w_current->pixbuf_filename);
w_current->pixbuf_filename=NULL;
}
@@ -408,7 +408,7 @@
new_node = s_basic_init_object("picture");
new_node->type = type;
- picture = (PICTURE *) malloc(sizeof(PICTURE));
+ picture = (PICTURE *) g_malloc(sizeof(PICTURE));
new_node->picture = picture;
/* describe the picture with its upper left and lower right corner */
@@ -439,7 +439,7 @@
*/
/*
if (w_current->current_pixbuf != NULL) {
- free (w_current->current_pixbuf);
+ g_free (w_current->current_pixbuf);
}
w_current->current_pixbuf = NULL;
w_current->pixbuf_wh_ratio = 0;
1.22 +1 -1 eda/geda/gaf/libgeda/src/o_pin_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_pin_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_pin_basic.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- o_pin_basic.c 5 Jul 2006 03:13:38 -0000 1.21
+++ o_pin_basic.c 15 Jul 2006 17:00:51 -0000 1.22
@@ -112,7 +112,7 @@
new_node->type = type;
new_node->color = color;
- new_node->line = (LINE *) malloc(sizeof(LINE));
+ new_node->line = (LINE *) g_malloc(sizeof(LINE));
new_node->line->x[0] = x1;
new_node->line->y[0] = y1;
1.7 +6 -6 eda/geda/gaf/libgeda/src/o_selection.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_selection.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_selection.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- o_selection.c 5 Jul 2006 03:13:38 -0000 1.6
+++ o_selection.c 15 Jul 2006 17:00:51 -0000 1.7
@@ -93,7 +93,7 @@
{
SELECTION *s_new;
- s_new = (SELECTION *) malloc(sizeof(SELECTION));
+ s_new = (SELECTION *) g_malloc(sizeof(SELECTION));
s_new->selected_object = NULL;
s_new->prev = NULL;
s_new->next = NULL;
@@ -108,7 +108,7 @@
*/
void o_selection_destroy_head(SELECTION *s_head)
{
- free(s_head);
+ g_free(s_head);
}
/*! \todo Finish function documentation!!!
@@ -122,7 +122,7 @@
SELECTION *tail;
SELECTION *s_new;
- s_new = (SELECTION *) malloc(sizeof(SELECTION));
+ s_new = (SELECTION *) g_malloc(sizeof(SELECTION));
if (o_selected != NULL) {
s_new->selected_object = o_selected;
@@ -178,7 +178,7 @@
o_selection_unselect(s_current->selected_object);
s_current->selected_object = NULL;
- free(s_current);
+ g_free(s_current);
return;
}
s_current = s_current->next;
@@ -208,7 +208,7 @@
s_current->selected_object);
s_current->selected_object = NULL;
- free(s_current);
+ g_free(s_current);
s_current = s_prev;
} else {
break;
@@ -258,7 +258,7 @@
while (s_current != NULL) {
s_prev = s_current->prev;
s_current->selected_object = NULL;
- free(s_current);
+ g_free(s_current);
s_current = s_prev;
}
}
1.20 +19 -19 eda/geda/gaf/libgeda/src/o_text_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_text_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_text_basic.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- o_text_basic.c 5 Jul 2006 03:13:38 -0000 1.19
+++ o_text_basic.c 15 Jul 2006 17:00:51 -0000 1.20
@@ -897,7 +897,7 @@
new_node = s_basic_init_object("text");
new_node->type = type;
- text = (TEXT *) malloc(sizeof(TEXT));
+ text = (TEXT *) g_malloc(sizeof(TEXT));
text->string = g_strdup (string);
text->length = strlen(string);
@@ -998,9 +998,9 @@
object_list->right = right;
object_list->bottom = bottom;
- if (name) free(name);
- if (value) free(value);
- if (output_string) free(output_string);
+ if (name) g_free(name);
+ if (value) g_free(value);
+ if (output_string) g_free(output_string);
return(object_list);
}
@@ -1359,9 +1359,9 @@
}
w_current->page_current->object_parent = temp_parent;
- if (name) free(name);
- if (value) free(value);
- if (output_string) free(output_string);
+ if (name) g_free(name);
+ if (value) g_free(value);
+ if (output_string) g_free(output_string);
}
/*! \todo Finish function documentation!!!
@@ -1515,7 +1515,7 @@
if (single_len > max_len)
{
max_len = strlen(single_line);
- if (max_length_line) free(max_length_line);
+ if (max_length_line) g_free(max_length_line);
max_length_line = g_strdup (single_line);
}
}
@@ -1535,8 +1535,8 @@
/* .95 is a fudge factor */
fprintf(fp, ") stringwidth pop\n");
- if (single_line) free(single_line);
- if (max_length_line) free(max_length_line);
+ if (single_line) g_free(single_line);
+ if (max_length_line) g_free(max_length_line);
}
/*! \todo Finish function documentation!!!
@@ -1720,9 +1720,9 @@
fprintf(fp,"] %d %d %d %f text\n",angle,x,y,font_size);
- if (output_string) free(output_string);
- if (name) free(name);
- if (value) free(value);
+ if (output_string) g_free(output_string);
+ if (name) g_free(name);
+ if (value) g_free(value);
}
/*! \todo Finish function documentation!!!
@@ -2026,9 +2026,9 @@
o_text_translate_world(w_current, x-object->text->x, y-object->text->y, object);
o_text_recreate(w_current, object);
- if (output_string) free(output_string);
- if (name) free(name);
- if (value) free(value);
+ if (output_string) g_free(output_string);
+ if (name) g_free(name);
+ if (value) g_free(value);
}
/*! \todo Finish function documentation!!!
@@ -2230,9 +2230,9 @@
/* don't know if this is needed ?*/
/* o_text_translate_world(w_current, x-object->text->x, y-object->text->y, object);*/
o_text_recreate(w_current, object);
- if (output_string) free(output_string);
- if (name) free(name);
- if (value) free(value);
+ if (output_string) g_free(output_string);
+ if (name) g_free(name);
+ if (value) g_free(value);
}
#endif
1.11 +8 -7 eda/geda/gaf/libgeda/src/s_attrib.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_attrib.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_attrib.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- s_attrib.c 5 Jul 2006 03:13:38 -0000 1.10
+++ s_attrib.c 15 Jul 2006 17:00:51 -0000 1.11
@@ -70,7 +70,8 @@
return(-1);
}
- attrib[attrib_index].attrib_name = (char *) malloc(sizeof(char)*strlen(new_attrib)+1);
+ attrib[attrib_index].attrib_name = (char *)
+ g_malloc(sizeof(char)*strlen(new_attrib)+1);
strcpy(attrib[attrib_index].attrib_name, new_attrib);
@@ -122,7 +123,7 @@
for (i = 0; i < attrib_index; i++) {
if (attrib[i].attrib_name)
- free(attrib[i].attrib_name);
+ g_free(attrib[i].attrib_name);
}
attrib_index=0;
1.22 +21 -21 eda/geda/gaf/libgeda/src/s_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_basic.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- s_basic.c 5 Jul 2006 03:13:38 -0000 1.21
+++ s_basic.c 15 Jul 2006 17:00:51 -0000 1.22
@@ -152,7 +152,7 @@
{
OBJECT *new_node;
- new_node = (OBJECT *) malloc(sizeof(OBJECT));
+ new_node = (OBJECT *) g_malloc(sizeof(OBJECT));
if (new_node == NULL) {
fprintf(stderr, "Could not perform malloc; something is broken or increase your process limits\n");
@@ -165,7 +165,7 @@
/* Setup the name */
/*! \todo get rid of magic number 16 that's the size of new_node->sid, */
- new_node->name = (char *) malloc(sizeof(char)*(strlen(name)+16));
+ new_node->name = (char *) g_malloc(sizeof(char)*(strlen(name)+16));
sprintf(new_node->name, "%s.%d", name, new_node->sid);
/* Setup the bounding box */
@@ -403,7 +403,7 @@
if (o_current->line) {
/* printf("sdeleting line\n");*/
- free(o_current->line);
+ g_free(o_current->line);
/* yes this object might be in the tile system */
s_tile_remove_object_all(w_current,
@@ -414,19 +414,19 @@
if (o_current->circle) {
/* printf("sdeleting circle\n");*/
- free(o_current->circle);
+ g_free(o_current->circle);
}
o_current->circle = NULL;
if (o_current->arc) {
/* printf("sdeleting arc\n");*/
- free(o_current->arc);
+ g_free(o_current->arc);
}
o_current->arc = NULL;
if (o_current->box) {
/* printf("sdeleting box\n");*/
- free(o_current->box);
+ g_free(o_current->box);
}
o_current->box = NULL;
@@ -434,20 +434,20 @@
/* printf("sdeleting picture\n");*/
#ifndef HAS_GTK12
if (o_current->picture->original_picture)
- free(o_current->picture->original_picture);
+ g_free(o_current->picture->original_picture);
if (o_current->picture->displayed_picture)
- free(o_current->picture->displayed_picture);
+ g_free(o_current->picture->displayed_picture);
#endif
if (o_current->picture->filename)
- free(o_current->picture->filename);
- free(o_current->picture);
+ g_free(o_current->picture->filename);
+ g_free(o_current->picture);
}
o_current->picture = NULL;
if (o_current->text) {
if (o_current->text->string) {
/*printf("sdeleting text->string\n");*/
- free(o_current->text->string);
+ g_free(o_current->text->string);
}
o_current->text->string = NULL;
@@ -459,26 +459,26 @@
o_current->text->prim_objs = NULL;
/* printf("sdeleting text\n");*/
- free(o_current->text);
+ g_free(o_current->text);
}
o_current->text = NULL;
if (o_current->name) {
/* printf("sdeleting name\n");*/
- free(o_current->name);
+ g_free(o_current->name);
}
o_current->name = NULL;
if (o_current->complex_basename) {
/* printf("sdeleting complex_basename\n");*/
- free(o_current->complex_basename);
+ g_free(o_current->complex_basename);
}
o_current->complex_basename = NULL;
if (o_current->complex_clib) {
/* printf("sdeleting complex_clib\n");*/
- free(o_current->complex_clib);
+ g_free(o_current->complex_clib);
}
o_current->complex_clib = NULL;
@@ -491,7 +491,7 @@
}
o_current->complex->prim_objs = NULL;
- free(o_current->complex);
+ g_free(o_current->complex);
o_current->complex = NULL;
}
@@ -501,7 +501,7 @@
o_current->attribs = NULL;
- free(o_current); /* assuming it is not null */
+ g_free(o_current); /* assuming it is not null */
o_current=NULL; /* misc clean up */
}
@@ -738,7 +738,7 @@
len = strlen(string);
- return_string = (char *) malloc(sizeof(char)*(len+1));
+ return_string = (char *) g_malloc(sizeof(char)*(len+1));
j = 0;
for (i = 0 ; i < len; i++) {
@@ -753,7 +753,7 @@
return_string[j] = '\0';
/* free original string */
- free(string);
+ g_free(string);
return(return_string);
}
@@ -789,7 +789,7 @@
insert_len = strlen(insert_string);
total_len = len+insert_len;
- new_string = (char *) malloc(sizeof(char)*(total_len+1));
+ new_string = (char *) g_malloc(sizeof(char)*(total_len+1));
i = 0;
while (i < total_len) {
@@ -808,7 +808,7 @@
new_string[i] = '\0';
/* now free the original string */
- free(string);
+ g_free(string);
return(new_string);
}
1.9 +4 -4 eda/geda/gaf/libgeda/src/s_color.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_color.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_color.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- s_color.c 5 Jul 2006 03:13:38 -0000 1.8
+++ s_color.c 15 Jul 2006 17:00:51 -0000 1.9
@@ -87,7 +87,7 @@
/* search for the color name see if it's already been alloced */
if (colors[color_index].color_name) {
- free(colors[color_index].color_name);
+ g_free(colors[color_index].color_name);
}
colors[color_index].color_name = g_strdup (color_name);
@@ -121,13 +121,13 @@
for (i = 0; i < MAX_COLORS; i++) {
if (colors[i].color_name) {
- free(colors[i].color_name);
+ g_free(colors[i].color_name);
}
if (colors[i].outline_color_name) {
- free(colors[i].outline_color_name);
+ g_free(colors[i].outline_color_name);
}
if (colors[i].ps_color_string) {
- free(colors[i].ps_color_string);
+ g_free(colors[i].ps_color_string);
}
colors[i].image_red = -1;
colors[i].image_green = -1;
1.5 +12 -11 eda/geda/gaf/libgeda/src/s_conn.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_conn.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_conn.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- s_conn.c 5 Jul 2006 03:13:38 -0000 1.4
+++ s_conn.c 15 Jul 2006 17:00:51 -0000 1.5
@@ -56,7 +56,7 @@
{
CONN *new_conn;
- new_conn = (CONN *) malloc(sizeof(CONN));
+ new_conn = (CONN *) g_malloc(sizeof(CONN));
#if DEBUG
printf("** creating: %s %d %d\n", other_object->name, x, y);
@@ -125,7 +125,7 @@
#endif
c_current->data = NULL;
- free(conn);
+ g_free(conn);
#if 0 /* this does not work right */
if (other_object->type == OBJ_BUS &&
@@ -177,13 +177,14 @@
conn->y);
#endif
c_current->data = NULL;
- free(conn);
+ g_free(conn);
c_current = c_current->next;
}
#if DEBUG
printf("length: %d\n", g_list_length(to_remove->conn_list));
#endif
+
g_list_free(to_remove->conn_list);
to_remove->conn_list = NULL; /*! \todo Memory leak? TODO hack */
@@ -391,7 +392,7 @@
object->conn_list =
g_list_append(object->conn_list, new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
new_conn = s_conn_return_new(object, CONN_ENDPOINT,
@@ -404,7 +405,7 @@
g_list_append(other_object->conn_list,
new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
#if DEBUG
@@ -487,7 +488,7 @@
object->conn_list =
g_list_append(object->conn_list, new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
new_conn = s_conn_return_new(object, CONN_ENDPOINT,
@@ -500,7 +501,7 @@
g_list_append(other_object->conn_list,
new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
#if DEBUG
@@ -568,7 +569,7 @@
object->conn_list =
g_list_append(object->conn_list, new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
/* Next do the current object and put it into the other */
@@ -583,7 +584,7 @@
g_list_append(other_object->conn_list,
new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
}
@@ -653,7 +654,7 @@
object->conn_list =
g_list_append(object->conn_list, new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
/* Next do the current object and put it into the other */
@@ -668,7 +669,7 @@
g_list_append(other_object->conn_list,
new_conn);
} else {
- free(new_conn);
+ g_free(new_conn);
}
}
1.14 +2 -2 eda/geda/gaf/libgeda/src/s_hierarchy.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_hierarchy.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_hierarchy.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- s_hierarchy.c 5 Jul 2006 03:13:39 -0000 1.13
+++ s_hierarchy.c 15 Jul 2006 17:00:51 -0000 1.14
@@ -169,7 +169,7 @@
w_current->page_current = found;
s_page_goto(w_current, found);
if (string)
- free(string);
+ g_free(string);
return;
}
@@ -191,7 +191,7 @@
/* w_current->page_current->down = NULL; not needed */
if (string)
- free(string);
+ g_free(string);
string = s_slib_search(filename, SLIB_SEARCH_NEXT);
}
1.2 +8 -8 eda/geda/gaf/libgeda/src/s_menu.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_menu.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_menu.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- s_menu.c 5 Jul 2006 03:13:39 -0000 1.1
+++ s_menu.c 15 Jul 2006 17:00:51 -0000 1.2
@@ -136,7 +136,7 @@
for (i = 0; i < menu_index; i++) {
if (menu[i].menu_name) {
- free(menu[i].menu_name);
+ g_free(menu[i].menu_name);
menu[i].menu_name = NULL;
}
}
1.11 +8 -7 eda/geda/gaf/libgeda/src/s_papersizes.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_papersizes.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_papersizes.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- s_papersizes.c 5 Jul 2006 03:13:39 -0000 1.10
+++ s_papersizes.c 15 Jul 2006 17:00:51 -0000 1.11
@@ -73,7 +73,8 @@
return(-1);
}
- papersizes[papersizes_index].papersize_name = (char *) malloc(sizeof(char)*strlen(new_papersize)+1);
+ papersizes[papersizes_index].papersize_name =
+ (char *) g_malloc(sizeof(char)*strlen(new_papersize)+1);
strcpy(papersizes[papersizes_index].papersize_name, new_papersize);
@@ -127,7 +128,7 @@
for (i = 0; i < papersizes_index; i++) {
if (papersizes[i].papersize_name)
- free(papersizes[i].papersize_name);
+ g_free(papersizes[i].papersize_name);
}
papersizes_index=0;
1.17 +17 -17 eda/geda/gaf/libgeda/src/s_slib.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_slib.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_slib.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- s_slib.c 5 Jul 2006 03:13:39 -0000 1.16
+++ s_slib.c 15 Jul 2006 17:00:51 -0000 1.17
@@ -80,7 +80,8 @@
return(-1);
}
- slib[slib_index].dir_name = (char *) malloc(sizeof(char)*strlen(new_path)+1);
+ slib[slib_index].dir_name =
+ (char *) g_malloc(sizeof(char)*strlen(new_path)+1);
strcpy(slib[slib_index].dir_name, new_path);
@@ -144,7 +145,7 @@
/* Do a substring comp for a match */
if (strstr(dptr->d_name, basename) != NULL) {
len = strlen(slib[i].dir_name);
- slib_path = (char *) malloc(sizeof(char)*len+1);
+ slib_path = (char *) g_malloc(sizeof(char)*len+1);
strcpy(slib_path, slib[i].dir_name);
if (ptr) {
@@ -197,11 +198,11 @@
/* The 2 is for NULL char and the slash inbetween the two */
/* strings */
- full_path = (char *) malloc(sizeof(char)*(len+2));
+ full_path = (char *) g_malloc(sizeof(char)*(len+2));
sprintf(full_path, "%s%c%s", slib_path, G_DIR_SEPARATOR, basename);
- free(slib_path);
+ g_free(slib_path);
return(full_path);
} else {
@@ -244,7 +245,7 @@
len = strlen(rawname)+1;
- return_filename = (char *) malloc(sizeof(char)*len);
+ return_filename = (char *) g_malloc(sizeof(char)*len);
i = 0;
/* first get everything up to the leading dot */
@@ -360,13 +361,13 @@
number_suffix = g_strdup_printf("_%d.sch", count);
len2 = strlen(number_suffix);
new_filename = (char *)
- malloc (sizeof(char)*(len+len2+1));
+ g_malloc (sizeof(char)*(len+len2+1));
sprintf(new_filename, "%s%s", processed_name, number_suffix);
string = s_slib_search_lowlevel(new_filename);
- free(new_filename);
- free(number_suffix);
+ g_free(new_filename);
+ g_free(number_suffix);
break;
case(SLIB_SEARCH_DONE):
@@ -376,7 +377,7 @@
}
if (processed_name)
- free(processed_name);
+ g_free(processed_name);
/* don't forget to free this string */
return(string);
@@ -417,7 +418,7 @@
for (i = 0; i < slib_index; i++) {
if (slib[i].dir_name)
- free(slib[i].dir_name);
+ g_free(slib[i].dir_name);
}
slib_index=0;
@@ -496,7 +497,7 @@
for (j = 0 ; j < count ;j++) {
if (whole_dir[j])
- free(whole_dir[j]);
+ g_free(whole_dir[j]);
}
count = current = 0 ;
@@ -514,7 +515,7 @@
for (j = 0 ; j < count ;j++) {
if (whole_dir[j])
- free(whole_dir[j]);
+ g_free(whole_dir[j]);
}
count = current = 0 ;
@@ -549,9 +550,8 @@
if (count < 256) {
whole_dir[count] = (char *)
- malloc(sizeof(char)*len+1);
- strcpy(whole_dir[count],
- dptr->d_name);
+ g_malloc(sizeof(char)*len+1);
+ strcpy(whole_dir[count], dptr->d_name);
count++;
} else {
fprintf(stderr,
1.5 +6 -6 eda/geda/gaf/libgeda/src/s_stretch.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_stretch.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_stretch.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- s_stretch.c 5 Jul 2006 03:13:39 -0000 1.4
+++ s_stretch.c 15 Jul 2006 17:00:51 -0000 1.5
@@ -93,7 +93,7 @@
{
STRETCH *s_new;
- s_new = (STRETCH *) malloc(sizeof(STRETCH));
+ s_new = (STRETCH *) g_malloc(sizeof(STRETCH));
s_new->object = NULL;
s_new->connection = NULL;
@@ -112,7 +112,7 @@
*/
void s_stretch_destroy_head(STRETCH *s_head)
{
- free(s_head);
+ g_free(s_head);
}
/*! \todo Finish function documentation!!!
@@ -142,7 +142,7 @@
}
/*printf("Adding: %s\n", object->name);*/
- s_new = (STRETCH *) malloc(sizeof(STRETCH));
+ s_new = (STRETCH *) g_malloc(sizeof(STRETCH));
s_new->object = object;
s_new->connection = connection;
s_new->whichone = whichone;
@@ -196,7 +196,7 @@
s_current->connection = NULL;
s_current->whichone = -1;
- free(s_current);
+ g_free(s_current);
return;
}
s_current = s_current->next;
@@ -224,7 +224,7 @@
s_current->connection = NULL;
s_current->whichone = -1;
- free(s_current);
+ g_free(s_current);
s_current = s_prev;
} else {
break;
@@ -288,7 +288,7 @@
s_current->connection = NULL;
s_current->whichone = -1;
- free(s_current);
+ g_free(s_current);
s_current = s_prev;
}
}
1.5 +2 -2 eda/geda/gaf/libgeda/src/s_tile.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_tile.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_tile.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- s_tile.c 5 Jul 2006 03:13:39 -0000 1.4
+++ s_tile.c 15 Jul 2006 17:00:51 -0000 1.5
@@ -106,7 +106,7 @@
{
TILE_LOC *tile_loc;
- tile_loc = (TILE_LOC *) malloc(sizeof(TILE_LOC));
+ tile_loc = (TILE_LOC *) g_malloc(sizeof(TILE_LOC));
tile_loc->i = i;
tile_loc->j = j;
@@ -381,7 +381,7 @@
i = tl_current->i;
j = tl_current->j;
- free(tl_current);
+ g_free(tl_current);
t_current = &p_current->world_tiles[i][j];
t_current->objects = g_list_remove(t_current->objects, object);
1.6 +9 -9 eda/geda/gaf/libgeda/src/s_undo.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_undo.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_undo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- s_undo.c 5 Jul 2006 03:13:39 -0000 1.5
+++ s_undo.c 15 Jul 2006 17:00:51 -0000 1.6
@@ -93,7 +93,7 @@
{
UNDO *u_new;
- u_new = (UNDO *) malloc(sizeof(UNDO));
+ u_new = (UNDO *) g_malloc(sizeof(UNDO));
u_new->type = -1;
u_new->filename = NULL;
u_new->object_head = NULL;
@@ -115,7 +115,7 @@
*/
void s_undo_destroy_head(UNDO *u_head)
{
- free(u_head);
+ g_free(u_head);
}
/*! \todo Finish function documentation!!!
@@ -130,7 +130,7 @@
UNDO *tail;
UNDO *u_new;
- u_new = (UNDO *) malloc(sizeof(UNDO));
+ u_new = (UNDO *) g_malloc(sizeof(UNDO));
u_new->filename = g_strdup (filename);
@@ -210,7 +210,7 @@
while (u_current != NULL) {
u_prev = u_current->prev;
- if (u_current->filename) free(u_current->filename);
+ if (u_current->filename) g_free(u_current->filename);
if (u_current->object_head) {
w_current->REMOVING_SEL = 1;
@@ -220,7 +220,7 @@
u_current->object_head = NULL;
}
- free(u_current);
+ g_free(u_current);
u_current = u_prev;
}
}
@@ -254,7 +254,7 @@
u_current->prev = NULL;
if (u_current->filename) {
- free(u_current->filename);
+ g_free(u_current->filename);
}
if (u_current->object_head) {
@@ -265,7 +265,7 @@
u_current->object_head = NULL;
}
- free(u_current);
+ g_free(u_current);
return;
}
u_current = u_current->next;
@@ -289,7 +289,7 @@
if (u_current->filename) {
unlink(u_current->filename);
- free(u_current->filename);
+ g_free(u_current->filename);
}
if (u_current->object_head) {
@@ -300,7 +300,7 @@
u_current->object_head = NULL;
}
- free(u_current);
+ g_free(u_current);
u_current = u_next;
}
}
1.11 +2 -2 eda/geda/gaf/libgeda/src/u_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: u_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/u_basic.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- u_basic.c 5 Jul 2006 03:13:39 -0000 1.10
+++ u_basic.c 15 Jul 2006 17:00:51 -0000 1.11
@@ -62,14 +62,14 @@
}
/* Allocate space for temp string storage (+1 for null character) */
- return_value = malloc(sizeof(char)*(strlen(string) + 1));
+ return_value = g_malloc(sizeof(char)*(strlen(string) + 1));
while(!done) {
/* oops, ran out of string before we found what we were */
/* looking for */
if (i > strlen(string)) {
- free(return_value);
+ g_free(return_value);
return(NULL);
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs