billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=0313446e79c84dd67c627cbb6dca136577260b8b

commit 0313446e79c84dd67c627cbb6dca136577260b8b
Author: Boris Faure <bill...@gmail.com>
Date:   Tue Mar 25 21:43:49 2014 +0100

    let's try to recover from malloc failure: ahah
---
 src/bin/termpty.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 03ccd5f..c342d64 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -90,6 +90,7 @@ _handle_buf(Termpty *ty, const Eina_Unicode *codepoints, int 
len)
                   if (!ty->buf)
                     {
                        ERR("memerr");
+                       return;
                     }
                   bytes = (char *)ce - (char *)c;
                   memcpy(ty->buf, c, bytes);
@@ -768,6 +769,8 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
    if (!ty->screen2)
      {
         ERR("memerr");
+        free(new_screen);
+        return;
      }
    new_back = calloc(sizeof(Termsave *), ty->backmax);
 

-- 


Reply via email to