--- mqtt/src/pubmqtt.c 2012/05/08 14:27:46 1.2.2.8 +++ mqtt/src/pubmqtt.c 2012/05/27 10:04:05 1.2.2.9 @@ -435,7 +435,7 @@ mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co /* calculate count of rows and allocate subscribe items */ while (sqlite3_step(stmt) == SQLITE_ROW) rowz++; - if (!(s = malloc((rowz + 1) * sizeof(mqtt_subscr_t)))) { + if (!(s = io_malloc((rowz + 1) * sizeof(mqtt_subscr_t)))) { mqtt_rtlm_log("Error:: System #%d - %s", errno, strerror(errno)); goto end; } else @@ -445,9 +445,9 @@ mqtt_rtlm_read_topic(cfg_root_t *cfg, sqlite3 *sql, co /* fill with data */ for (j = 0; j < rowz && sqlite3_step(stmt) == SQLITE_ROW; j++) { s[j].sub_ret = (char) sqlite3_column_int(stmt, 0); - s[j].sub_topic.msg_base = (u_char*) strdup((char*) sqlite3_column_text(stmt, 1)); + s[j].sub_topic.msg_base = (u_char*) io_strdup((char*) sqlite3_column_text(stmt, 1)); s[j].sub_topic.msg_len = strlen((char*) s[j].sub_topic.msg_base); - s[j].sub_value.msg_base = (u_char*) strdup((char*) sqlite3_column_text(stmt, 2)); + s[j].sub_value.msg_base = (u_char*) io_strdup((char*) sqlite3_column_text(stmt, 2)); s[j].sub_value.msg_len = strlen((char*) s[j].sub_value.msg_base); } end: @@ -590,7 +590,7 @@ mqtt_rtlm_read_subscribe(cfg_root_t *cfg, sqlite3 *sql /* calculate count of rows and allocate subscribe items */ while (sqlite3_step(stmt) == SQLITE_ROW) rowz++; - if (!(s = malloc((rowz + 1) * sizeof(mqtt_subscr_t)))) { + if (!(s = io_malloc((rowz + 1) * sizeof(mqtt_subscr_t)))) { mqtt_rtlm_log("Error:: System #%d - %s", errno, strerror(errno)); goto end; } else @@ -600,7 +600,7 @@ mqtt_rtlm_read_subscribe(cfg_root_t *cfg, sqlite3 *sql /* fill with data */ for (j = 0; j < rowz && sqlite3_step(stmt) == SQLITE_ROW; j++) { s[j].sub_ret = (char) sqlite3_column_int(stmt, 0); - s[j].sub_topic.msg_base = (u_char*) strdup((char*) sqlite3_column_text(stmt, 1)); + s[j].sub_topic.msg_base = (u_char*) io_strdup((char*) sqlite3_column_text(stmt, 1)); s[j].sub_topic.msg_len = strlen((char*) s[j].sub_topic.msg_base); s[j].sub_value.msg_base = NULL; s[j].sub_value.msg_len = 0;