[Asterisk-code-review] cdr adaptive odbc: Set character for quoted identifiers. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Tue Apr 28 05:54:34 CDT 2015


Joshua Colp has posted comments on this change.

Change subject: cdr_adaptive_odbc: Set character for quoted identifiers.
......................................................................


Patch Set 3: Code-Review-1

(4 comments)

https://gerrit.asterisk.org/#/c/246/3/CHANGES
File CHANGES:

Line 144:  * Added the ability to set the character to quote indentifiers. This allows add
        :    the character and init and end of table and columns names.  This setting is
        :    configurable for cdr_adaptive_odbc via the quoted_identifiers in file
        :    cdr_adaptive_odbc.conf.
Added the ability to set the character to quote identifiers. This
allows adding the character at the start and end of table and column
names. This setting is configurable for cdr_adaptive_odbc via the
quoted_identifiers in configuration file cdr_adaptive_odbc.conf.


https://gerrit.asterisk.org/#/c/246/3/cdr/cdr_adaptive_odbc.c
File cdr/cdr_adaptive_odbc.c:

Line 418: 		}else{
Spacing. } else {


Line 419: 			struct ast_str *t = ast_str_create(maxsize), *s = ast_str_create(maxsize2);
This has a memory leak. You aren't freeing these strings afterwards.


Line 422: ast_copy_string(table, ast_str_buffer(t), sizeof(table));
        : 			ast_copy_string(schema, ast_str_buffer(s), sizeof(schema));
Why don't you just use snprintf to construct the quoted values directly in table and schema?


-- 
To view, visit https://gerrit.asterisk.org/246
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b9a56b79ca13a727a803d88ed3b8643e37632b8
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Rodrigo Ramirez Norambuena <decipher.hk at gmail.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list