=== modified file 'driver-csi.c' --- driver-csi.c 2008-10-09 22:19:10 +0000 +++ driver-csi.c 2008-10-09 19:23:45 +0000 @@ -37,8 +37,6 @@ // Excellent - we'll continue termkey_csi *csi = malloc(sizeof *csi); - if(!csi) - return NULL; csi->tk = tk; @@ -53,8 +51,6 @@ csi->ncsifuncs = 32; csi->csifuncs = malloc(sizeof(csi->csifuncs[0]) * csi->ncsifuncs); - if(!csi->csifuncs) - goto abort_free_csi; for(i = 0; i < csi->ncsifuncs; i++) csi->csifuncs[i].sym = TERMKEY_SYM_UNKNOWN; @@ -123,11 +119,6 @@ register_csifunc(csi, TERMKEY_TYPE_FUNCTION, 20, 34, NULL); return csi; - -abort_free_csi: - free(csi); - - return NULL; } static void free_driver(void *private) === modified file 'driver-ti.c' --- driver-ti.c 2008-10-09 22:19:10 +0000 +++ driver-ti.c 2008-10-09 19:23:45 +0000 @@ -33,8 +33,6 @@ return NULL; termkey_ti *ti = malloc(sizeof *ti); - if(!ti) - return NULL; ti->tk = tk; @@ -42,8 +40,6 @@ ti->nseqs = 0; ti->seqs = malloc(ti->alloced_seqs * sizeof(ti->seqs[0])); - if(!ti->seqs) - goto abort_free_ti; int i; for(i = 0; strfnames[i]; i++) { @@ -68,11 +64,6 @@ } return ti; - -abort_free_ti: - free(ti); - - return NULL; } static void free_driver(void *private) === modified file 'termkey.c' --- termkey.c 2008-10-09 22:19:10 +0000 +++ termkey.c 2008-10-09 19:23:45 +0000 @@ -96,8 +96,10 @@ tk->flags = flags; tk->buffer = malloc(buffsize); - if(!tk->buffer) - goto abort_free_tk; + if(!tk->buffer) { + free(tk); + return NULL; + } tk->buffstart = 0; tk->buffcount = 0; @@ -111,8 +113,6 @@ tk->nkeynames = 64; tk->keynames = malloc(sizeof(tk->keynames[0]) * tk->nkeynames); - if(!tk->keynames) - goto abort_free_buffer; int i; for(i = 0; i < tk->nkeynames; i++) @@ -147,7 +147,7 @@ if(!tk->driver_info) { fprintf(stderr, "Unable to find a terminal driver\n"); - goto abort_free_keynames; + return NULL; } if(!(flags & TERMKEY_FLAG_NOTERMIOS)) { @@ -164,17 +164,6 @@ } return tk; - -abort_free_keynames: - free(tk->keynames); - -abort_free_buffer: - free(tk->buffer); - -abort_free_tk: - free(tk); - - return NULL; } termkey_t *termkey_new(int fd, int flags)