SHA256
1
0
forked from pool/tcsh
tcsh/tcsh-6.18.01-blk_buf.patch
2012-05-10 08:01:23 +00:00

22 lines
430 B
Diff

--- tc.str.c
+++ tc.str.c 2012-05-10 07:57:01.358065084 +0000
@@ -590,10 +590,14 @@ bb_cleanup(void *xbb)
struct blk_buf *bb;
size_t i;
- bb = xbb;
- for (i = 0; i < bb->len; i++)
- xfree(bb->vec[i]);
- xfree(bb->vec);
+ bb = (struct blk_buf *)xbb;
+ if (bb->vec) {
+ for (i = 0; i < bb->len; i++)
+ xfree(bb->vec[i]);
+ xfree(bb->vec);
+ }
+ bb->vec = (Char**)0;
+ bb->len = 0;
}
void