Merge lp://qastaging/~kklimonda/couchdb-glib/fix-memleaks into lp://qastaging/couchdb-glib
Proposed by
Krzysztof Klimonda
| Status: | Merged |
|---|---|
| Merge reported by: | Rodrigo Moya |
| Merged at revision: | not available |
| Proposed branch: | lp://qastaging/~kklimonda/couchdb-glib/fix-memleaks |
| Merge into: | lp://qastaging/couchdb-glib |
| Diff against target: |
32 lines (+8/-2) 1 file modified
couchdb-glib/couchdb-session.c (+8/-2) |
| To merge this branch: | bzr merge lp://qastaging/~kklimonda/couchdb-glib/fix-memleaks |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Rodrigo Moya (community) | Approve | ||
|
Review via email:
|
|||
Description of the change
Fixes two more small memleaks - url created by g_strdup_printf and dbinfo created in couchdb_
To post a comment you must log in.
There is a little mistake, you are calling couchdb_ database_ new twice. So fixed and pushed this to GIT master:
diff --git a/couchdb- glib/couchdb- session. c b/couchdb- glib/couchdb- session. c glib/couchdb- session. c glib/couchdb- session. c session_ get_database_ info (CouchdbSession *session,
g_object_ unref (G_OBJECT (parser));
index 9d38fd7..c995751 100644
--- a/couchdb-
+++ b/couchdb-
@@ -319,6 +319,7 @@ couchdb_
}
}
+ g_free (url);
return result; session_ get_database (CouchdbSession *session, cons
g_return_ val_if_ fail (dbname != NULL, NULL);
}
@@ -343,8 +344,14 @@ couchdb_
dbinfo = couchdb_ session_ get_database_ info (session, dbname, error); database_ new (session, dbname); database_ new (session, dbname); database_ info_unref (dbinfo);
- if (dbinfo != NULL)
- return couchdb_
+ if (dbinfo != NULL) {
+ CouchdbDatabase *db;
+
+ db = couchdb_
+ couchdb_
+
+ return db;
+ }
return NULL;
}