pat = NULL; // search_regcomp() will use previous pattern
patlen = 0;
sub = vim_strsave(old_sub);
+ if (sub == NULL)
+ return;
// Vi compatibility quirk: repeating with ":s" keeps the cursor in the
// last column after using "$".
vim_free(sub_firstline);
sub_firstline = vim_strnsave(ml_get(sub_firstlnum),
ml_get_len(sub_firstlnum));
+ if (sub_firstline == NULL)
+ {
+ vim_free(new_start);
+ goto outofmem;
+ }
+
// When going beyond the last line, stop substituting.
if (sub_firstlnum <= line2)
do_again = TRUE;
// less than what it ought to be.
vim_free(sub_firstline);
sub_firstline = vim_strsave((char_u *)"");
+ if (sub_firstline == NULL)
+ {
+ vim_free(new_start);
+ goto outofmem;
+ }
copycol = 0;
}