Index: res_odbc.c =================================================================== --- res_odbc.c (revision 98083) +++ res_odbc.c (working copy) @@ -52,8 +52,10 @@ AST_LIST_ENTRY(odbc_class) list; char name[80]; char dsn[80]; - char username[80]; - char password[80]; + char buf_username[80]; + char buf_password[80]; + char *username; + char *password; char sanitysql[256]; SQLHENV env; unsigned int haspool:1; /* Boolean - TDS databases need this */ @@ -296,10 +298,20 @@ ast_copy_string(new->name, cat, sizeof(new->name)); if (dsn) ast_copy_string(new->dsn, dsn, sizeof(new->dsn)); - if (username) + if (username) { + new->username = new->buf_username; ast_copy_string(new->username, username, sizeof(new->username)); - if (password) + } + else { + new->username = NULL; + } + if (password) { + new->password = new->buf_password; ast_copy_string(new->password, password, sizeof(new->password)); + } + else { + new->password = NULL; + } if (sanitysql) ast_copy_string(new->sanitysql, sanitysql, sizeof(new->sanitysql));