]> granicus.if.org Git - php/commitdiff
Removed unneeded checks around Zend allocation macros.
authorIlia Alshanetsky <iliaa@php.net>
Sun, 20 Jun 2004 21:40:43 +0000 (21:40 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 20 Jun 2004 21:40:43 +0000 (21:40 +0000)
ext/standard/levenshtein.c

index 83d7d6f4c93439f6e5526cb6c0058143910b730c..ba9445da20722a44cd663626be58fd338b9079f4 100644 (file)
@@ -40,13 +40,8 @@ static int reference_levdist(const char *s1, int l1,
        if((l1>LEVENSHTEIN_MAX_LENTH)||(l2>LEVENSHTEIN_MAX_LENTH))
                return -1;
 
-       if(!(p1=safe_emalloc((l2+1), sizeof(int), 0))) {
-               return -2;
-       }
-       if(!(p2=safe_emalloc((l2+1), sizeof(int), 0))) {
-               free(p1);
-               return -2;
-       }
+       p1 = safe_emalloc((l2+1), sizeof(int), 0);
+       p2 = safe_emalloc((l2+1), sizeof(int), 0);
 
        for(i2=0;i2<=l2;i2++)
                p1[i2] = i2*cost_ins;