summaryrefslogtreecommitdiff
path: root/ext/standard/metaphone.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/metaphone.c')
-rw-r--r--ext/standard/metaphone.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index e6cc2cf67f..10e3396edf 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -145,9 +145,7 @@ static char Lookahead(char *word, int how_far)
* could be one though; or more too). */
#define Phonize(c) { \
if (p_idx >= max_buffer_len) { \
- if (NULL == (*phoned_word = erealloc(*phoned_word, max_buffer_len + 2))) { \
- return -1; \
- } \
+ *phoned_word = erealloc(*phoned_word, max_buffer_len + 2); \
max_buffer_len += 2; \
} \
(*phoned_word)[p_idx++] = c; \
@@ -185,13 +183,9 @@ static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_w
if (max_phonemes == 0) { /* Assume largest possible */
max_buffer_len = word_len;
*phoned_word = emalloc(sizeof(char) * word_len + 1);
- if (!*phoned_word)
- return -1;
} else {
max_buffer_len = max_phonemes;
*phoned_word = emalloc(sizeof(char) * max_phonemes + 1);
- if (!*phoned_word)
- return -1;
}