]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID: 1211948 fix memory leak of decoded iks message in function parse_plain_auth_mess...
authorWilliam King <william.king@quentustech.com>
Wed, 7 May 2014 07:44:54 +0000 (00:44 -0700)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 8 May 2014 13:52:20 +0000 (09:52 -0400)
src/mod/event_handlers/mod_rayo/sasl.c

index be794330cdd5f03490e94c444ebf4e00e7c93649..c93146d13b85b0f1a33264fc0fb6b22b4f70fa8d 100644 (file)
@@ -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: