src/string.c

changeset 380
2c9a5aebaee1
parent 379
477404eb380e
child 383
db4c6b94939b
equal deleted inserted replaced
379:477404eb380e 380:2c9a5aebaee1
710 if (match.length > 0) { 710 if (match.length > 0) {
711 /* Allocate next buffer in chain, if required */ 711 /* Allocate next buffer in chain, if required */
712 if (curbuf->len == ibuflen) { 712 if (curbuf->len == ibuflen) {
713 struct scstrreplace_ibuf *nextbuf = 713 struct scstrreplace_ibuf *nextbuf =
714 calloc(1, sizeof(struct scstrreplace_ibuf)); 714 calloc(1, sizeof(struct scstrreplace_ibuf));
715 if (!nextbuf) return sstrn(NULL, 0); 715 if (!nextbuf) {
716 scstrrepl_free_ibuf(firstbuf);
717 return sstrn(NULL, 0);
718 }
716 nextbuf->buf = calloc(ibuflen, sizeof(size_t)); 719 nextbuf->buf = calloc(ibuflen, sizeof(size_t));
717 if (!nextbuf->buf) { 720 if (!nextbuf->buf) {
718 free(nextbuf); 721 free(nextbuf);
719 scstrrepl_free_ibuf(firstbuf); 722 scstrrepl_free_ibuf(firstbuf);
720 return sstrn(NULL, 0); 723 return sstrn(NULL, 0);

mercurial