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
This commit is contained in:
Alexei Gradinari
2016-08-19 11:21:01 -04:00
parent cab6975b02
commit b494b9f88c

View File

@@ -966,7 +966,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);