History

Cleanup

cancel committed 6 years ago

Commit ba5a58b1 parent 2a1ad3f1 file · +12 −20Browse files

Unified · Split

sysmisc.c+12−20
@@ -288,35 +288,25 @@ Conf_save_start_error conf_save_start(Conf_save *p, · 287 unmodified lines
288288 err = Conf_save_start_no_home;
289289 goto cleanup;
290290 }
291− if (!dir) {
292− err = Conf_save_start_alloc_failed;
293− goto cleanup;
294− }
291+ if (!dir)
292+ goto allocfail;
295293 osoputoso(&p->canonpath, dir);
296− if (!p->canonpath) {
297− err = Conf_save_start_alloc_failed;
298− goto cleanup;
299− }
294+ if (!p->canonpath)
295+ goto allocfail;
300296 size_t namelen = strlen(conf_file_name);
301297 if (namelen == 0) {
302298 err = Conf_save_start_bad_conf_name;
303299 goto cleanup;
304300 }
305301 conf_impl_catconfpath(&p->canonpath, conf_file_name, namelen);
306− if (!p->canonpath) {
307− err = Conf_save_start_alloc_failed;
308− goto cleanup;
309− }
302+ if (!p->canonpath)
303+ goto allocfail;
310304 osoputoso(&p->temppath, p->canonpath);
311− if (!p->temppath) {
312− err = Conf_save_start_alloc_failed;
313− goto cleanup;
314− }
305+ if (!p->temppath)
306+ goto allocfail;
315307 osocat(&p->temppath, ".tmp");
316− if (!p->temppath) {
317− err = Conf_save_start_alloc_failed;
318− goto cleanup;
319− }
308+ if (!p->temppath)
309+ goto allocfail;
320310 // Remove old temp file if it exists. If it exists and we can't remove it,
321311 // error.
322312 if (unlink(osoc(p->temppath)) == -1 && errno != ENOENT) {
@@ -350,6 +340,8 @@ Conf_save_start_error conf_save_start(Conf_save *p, · 27 unmodified lines
350340 osofree(dir);
351341 return Conf_save_start_ok;
352342
343+allocfail:
344+ err = Conf_save_start_alloc_failed;
353345 cleanup:
354346 osofree(dir);
355347 conf_save_cancel(p);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t