[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/12] Guile-DBII: replace deprecated gh_ functions
From: |
Linas Vepstas |
Subject: |
[PATCH 4/12] Guile-DBII: replace deprecated gh_ functions |
Date: |
Fri, 19 Sep 2008 09:09:46 -0500 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
Replace deprecated gh_ functions with modern scm_ functions
Also, another memory leak.
Signed-off-by: Linas Vepstas <address@hidden>
---
src/guile-dbi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: guile-dbi-2.0.0/src/guile-dbi.c
===================================================================
--- guile-dbi-2.0.0.orig/src/guile-dbi.c 2008-09-16 18:44:31.000000000
-0500
+++ guile-dbi-2.0.0/src/guile-dbi.c 2008-09-16 18:47:11.000000000 -0500
@@ -214,7 +214,7 @@ SCM_DEFINE (query_g_db_handle, "dbi-quer
SCM_ASSERT (scm_is_string (query), query, SCM_ARG2, "query_g_db_handle");
g_db_handle = (struct g_db_handle*)SCM_SMOB_DATA(db_handle);
- query_str = (char*) gh_scm2newstr(query,NULL);
+ query_str = scm_to_locale_string(query);
__gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbi_query);
if (scm_equal_p (SCM_CAR(g_db_handle->status),scm_from_int(0)) == SCM_BOOL_F)
@@ -315,11 +315,12 @@ __gdbi_dbd_wrap(gdbi_db_handle_t* dbh, c
char *func = NULL;
char *bcknd = NULL;
- bcknd = (char*) gh_scm2newstr(dbh->bcknd,NULL);
+ bcknd = scm_to_locale_string(dbh->bcknd);
if((func=malloc(sizeof(char)*(strlen(function_name)+
20))) == NULL)
{
+ free(bcknd);
dbh->status = (SCM) scm_cons(scm_from_int(errno),
scm_makfrom0str(strerror(errno)));
return;
@@ -329,6 +330,7 @@ __gdbi_dbd_wrap(gdbi_db_handle_t* dbh, c
*(void **) (function_pointer) = dlsym(dbh->handle,func);
if((ret = dlerror()) != NULL)
{
+ free(bcknd);
dbh->status = (SCM) scm_cons(scm_from_int(1),
scm_makfrom0str(ret));
return;
signature.asc
Description: Digital signature
- PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres, Linas Vepstas, 2008/09/19
- [PATCH 1/12] Guile-DBI: Avoid multiple init, Linas Vepstas, 2008/09/19
- [PATCH 2/12] Guile-DBI: minor cleanup, Linas Vepstas, 2008/09/19
- [PATCH 3/12] Guile-DBI: Fix memory leak, Linas Vepstas, 2008/09/19
- [PATCH 4/12] Guile-DBII: replace deprecated gh_ functions,
Linas Vepstas <=
- [PATCH 6/12] Guile-DBI: Fix crash, avoid recursive free, Linas Vepstas, 2008/09/19
- [PATCH 5/12] Guile-DBI: Use remember_upto_here, Linas Vepstas, 2008/09/19
- [PATCH 7/12] Guile-DBI: Don't cast away const, Linas Vepstas, 2008/09/19
- [PATCH 8/12] Guile-DBD-postgres: Fix handling of float point columns, Linas Vepstas, 2008/09/19
- [PATCH 9/12] Guile-DBD-postgres: Avoid discouraged functions, Linas Vepstas, 2008/09/19
- [PATCH 10/12] Guile-DBD-postgres: Fix off-by-one when fetching rows, Linas Vepstas, 2008/09/19
- [PATCH 11/12] Guile-DBD-postgres: Avoid deprecated functions, Linas Vepstas, 2008/09/19
- [PATCH 12/12] Guile-DBD-postgres: Crash in GC, Linas Vepstas, 2008/09/19
- Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres, Neil Jerram, 2008/09/19