fname = findswapname(buf, &dirp, mfp->mf_fname);
+ if (dirp == NULL) /* out of memory */
if (fname == NULL) /* no file name found for this dir */
* and creating it, another Vim creates the file. In that case the
* creation will fail and we will use another directory. */
fname = findswapname(buf, &dirp, NULL); /* allocates fname */
+ break; /* out of memory */
if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
* Several names are tried to find one that does not exist
* Returns the name in allocated memory or NULL.
+ * When out of memory "dirp" is set to NULL.
* Note: If BASENAMELEN is not correct, you will get error messages for
* not being able to open the swap or undo file
* First allocate some memory to put the directory name in.
dir_name = alloc((unsigned)STRLEN(*dirp) + 1);
(void)copy_option_part(dirp, dir_name, 31000, ",");