diff options
Diffstat (limited to 'main/enum.c')
-rw-r--r-- | main/enum.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/main/enum.c b/main/enum.c index 413085e7f..9c31c93b2 100644 --- a/main/enum.c +++ b/main/enum.c @@ -790,6 +790,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds if (sdl > strlen(number)) { /* Number too short for this sdl? */ ast_log(LOG_WARNING, "I-ENUM: subdomain location %d behind number %s\n", sdl, number); + ast_free(context); return 0; } ast_copy_string(left, number + sdl, sizeof(left)); @@ -802,6 +803,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds /* check the space we need for middle */ if ((sdl * 2 + strlen(middle) + 2) > sizeof(middle)) { ast_log(LOG_WARNING, "ast_get_enum: not enough space for I-ENUM rewrite.\n"); + ast_free(context); return -1; } @@ -819,6 +821,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds if (strlen(left) * 2 + 2 > sizeof(domain)) { ast_log(LOG_WARNING, "string to long in ast_get_enum\n"); + ast_free(context); return -1; } |