Skip to content
Snippets Groups Projects
Commit 64d77b83 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Fixed obscure memory leak.

Rev: src/modules/Odbc/odbc.c:1.18
parent d4bb2a53
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: odbc.c,v 1.17 1999/03/28 17:50:02 marcus Exp $ * $Id: odbc.c,v 1.18 1999/05/18 02:06:09 grubba Exp $
* *
* Pike interface to ODBC compliant databases. * Pike interface to ODBC compliant databases.
* *
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "config.h" #include "config.h"
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
RCSID("$Id: odbc.c,v 1.17 1999/03/28 17:50:02 marcus Exp $"); RCSID("$Id: odbc.c,v 1.18 1999/05/18 02:06:09 grubba Exp $");
#include "interpret.h" #include "interpret.h"
#include "object.h" #include "object.h"
...@@ -203,14 +203,25 @@ static void f_create(INT32 args) ...@@ -203,14 +203,25 @@ static void f_create(INT32 args)
* database argument is ignored * database argument is ignored
*/ */
if (!pwd) { if (!server) {
pwd = make_shared_string(""); push_constant_text("default");
server = sp[-1].u.string;
args++;
}
if (!database) {
push_constant_text("");
database = sp[-1].u.string;
args++;
} }
if (!user) { if (!user) {
user = make_shared_string(""); push_constant_text("");
user = sp[-1].u.string;
args++;
} }
if (!server) { if (!pwd) {
server = make_shared_string("default"); push_constant_text("");
pwd = sp[-1].u.string;
args++;
} }
if (PIKE_ODBC->flags & PIKE_ODBC_CONNECTED) { if (PIKE_ODBC->flags & PIKE_ODBC_CONNECTED) {
PIKE_ODBC->flags &= ~PIKE_ODBC_CONNECTED; PIKE_ODBC->flags &= ~PIKE_ODBC_CONNECTED;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment