compilation failed with -Werror=maybe-uninitialized

The compilation failed for devmode
--enable DONT_OPTIMIZE
--enable BETTER_BACKTRACES
--enable DO_CRASH
--enable TEST_FRAMEWORK

res_pjsip/pjsip_configuration.c: In function dtls_handler:
res_pjsip/pjsip_configuration.c:974:20: error:
back may be used uninitialized in this function [-Werror=maybe-uninitialized]
int size = strlen(front);
           ^
cc1: all warnings being treated as errors

Change-Id: I7f082ead0312792a577ec7c73015ba64dabca580
changes/71/3671/1
Alexei Gradinari 9 years ago
parent d6b5f1b951
commit 41ee14bfae

@ -963,7 +963,9 @@ static int dtls_handler(const struct aco_option *opt,
{
struct ast_sip_endpoint *endpoint = obj;
char *name = ast_strdupa(var->name);
char *front, *back, *buf = name;
char *front = NULL;
char *back = NULL;
char *buf = name;
/* strip out underscores in the name */
front = strtok_r(buf, "_", &back);

Loading…
Cancel
Save