Commit c1429b22 authored by Amin Ben Ramdhane's avatar Amin Ben Ramdhane

XMPP: cleanup

parent fec59385
Pipeline #987 passed with stage
in 48 seconds
......@@ -177,7 +177,8 @@ icwmp_xmppd_SOURCES = \
icwmp_xmppd_CFLAGS = \
$(AM_CFLAGS) \
$(LIBUCI_CFLAGS)
$(LIBUCI_CFLAGS) \
-Wall -Werror
icwmp_xmppd_LDFLAGS = \
$(AM_LDFLAGS) \
......
......@@ -61,7 +61,7 @@ static int send_stanza_cr_error(xmpp_conn_t * const conn, xmpp_stanza_t * const
{
xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
xmpp_stanza_t *cr_stanza, *child, *child1, *child2, *child3, *child4, *child5, *stext, *stext2, *mech;
char *username, *password;
char *username = NULL, *password = NULL;
cr_stanza = xmpp_stanza_new(ctx);
if (!cr_stanza) {
......@@ -120,8 +120,8 @@ static int send_stanza_cr_error(xmpp_conn_t * const conn, xmpp_stanza_t * const
xmpp_stanza_release(child);
xmpp_send(conn, cr_stanza);
xmpp_stanza_release(cr_stanza);
free(username);
free(password);
if (username) free(username);
if (password) free(password);
return 0;
}
......@@ -154,7 +154,6 @@ int check_xmpp_authorized(char *from)
static int cr_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza1, void * const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t*)userdata;
char *name_space, *text, *from, *username, *password;
xmpp_stanza_t *child, *mech;
bool valid_ns = true, auth_status = false, service_available = false;
......
......@@ -32,7 +32,6 @@ static int pfds[2];
int xmpp_cmd(unsigned char dowait, int argc, ...)
{
int pid;
char *c = NULL;
va_list arg;
if (pipe(pfds) < 0)
......
......@@ -50,7 +50,6 @@ static const char* log_str[] = {
void cwmp_xmpp_log(int priority, const char *format, ...)
{
va_list vl;
char *log;
if (priority <= cur_xmpp_conf.xmpp_loglevel) {
#ifdef DEBUG
......
......@@ -67,9 +67,6 @@ static bool dmuci_validate_section(const char *str)
static int dmuci_init_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *package, char *section, char *option, char *value)
{
char *last = NULL;
char *tmp;
memset(ptr, 0, sizeof(struct uci_ptr));
/* value */
......@@ -135,8 +132,7 @@ struct uci_section *dmuci_walk_section(char *package, char *section_type, struct
}
}
else {
struct uci_list *ul, *u = NULL;
struct uci_list *shead = NULL;
struct uci_list *ul, *shead = NULL;
if (prev_section) {
ul = &prev_section->e.list;
......@@ -168,8 +164,6 @@ void dmuci_print_list(struct uci_list *uh, char **val, char *delimiter)
{
struct uci_element *e;
static char buffer[512];
int dlen = strlen(delimiter);
int olen = 0;
char *buf = buffer;
*buf = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment