1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 15:40:38 +02:00

* gh_data.c (gh_scm2newstr, gh_symbol2newstr): Use

scm_must_malloc, not raw malloc.
This commit is contained in:
Jim Blandy 1997-04-24 02:31:22 +00:00
parent 939181998e
commit 9b1b00fe90

View file

@ -178,7 +178,8 @@ gh_scm2newstr (SCM str, int *lenp)
len = SCM_LENGTH (str);
ret_str = (char *) malloc ((len + 1) * sizeof (char));
ret_str = (char *) scm_must_malloc ((len + 1) * sizeof (char),
"gh_scm2newstr");
/* so we copy tmp_str to ret_str, which is what we will allocate */
memcpy (ret_str, SCM_CHARS (str), len);
/* now make sure we null-terminate it */
@ -239,7 +240,8 @@ gh_symbol2newstr (SCM sym, int *lenp)
len = SCM_LENGTH (sym);
ret_str = (char *) malloc ((len + 1) * sizeof (char));
ret_str = (char *) scm_must_malloc ((len + 1) * sizeof (char),
"gh_symbol2newstr");
/* so we copy tmp_str to ret_str, which is what we will allocate */
memcpy (ret_str, SCM_CHARS (sym), len);
/* now make sure we null-terminate it */