mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-19 01:45:32 +00:00
CID: 1211948 fix memory leak of decoded iks message in function parse_plain_auth_message in mod_rayo
This commit is contained in:
parent
e19bafe894
commit
8b3e039c71
@ -46,16 +46,16 @@ void parse_plain_auth_message(const char *message, char **authzid, char **authci
|
||||
*authcid = NULL;
|
||||
*password = NULL;
|
||||
if (decoded == NULL) {
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
pos = strlen(decoded) + 1;
|
||||
if (pos >= maxlen) {
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
*authcid = strdup(decoded + pos);
|
||||
pos += strlen(*authcid) + 1;
|
||||
if (pos >= maxlen) {
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
*password = strdup(decoded + pos);
|
||||
if (zstr(decoded)) {
|
||||
@ -63,7 +63,9 @@ void parse_plain_auth_message(const char *message, char **authzid, char **authci
|
||||
} else {
|
||||
*authzid = strdup(decoded);
|
||||
}
|
||||
free(decoded);
|
||||
|
||||
end:
|
||||
switch_safe_free(decoded);
|
||||
}
|
||||
|
||||
/* For Emacs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user