Navigation


Changeset 1233:0b4abb03bcaf in freeDiameter


Ignore:
Timestamp:
Sep 4, 2013, 9:14:31 AM (8 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix double increment when realloc resulting in invalid SQL query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_acct/acct_db.c

    r1127 r1233  
    175175       
    176176        if (acct_config->tsfield) {
    177                 ADD_EXTEND("$%d, ", ++idx);
     177                ++idx;
     178                ADD_EXTEND("$%d, ", idx);
    178179        }
    179180        if (acct_config->srvnfield) {
     
    185186        for (li = emptyrecords.all.next; li != &emptyrecords.all; li = li->next) {
    186187                struct acct_record_item * i = (struct acct_record_item *)(li->o);
    187                 ADD_EXTEND("$%d::%s", ++idx, diam2db_types_mapping[i->param->avptype]);
     188                ++idx;
     189                ADD_EXTEND("$%d::%s", idx, diam2db_types_mapping[i->param->avptype]);
    188190               
    189191                if (li->next != &emptyrecords.all) {
Note: See TracChangeset for help on using the changeset viewer.