Eliminate unnecessary fsm->path/opath shuffle on backup renaming
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 16 Jan 2012 10:28:52 +0000 (12:28 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 16 Jan 2012 10:43:51 +0000 (12:43 +0200)
commitf34f68dca6c7ffa08c58843206d4786a32d9b622
treef503fd2981f4cd446217e4a82c549abc80806c3d
parente671fef91b9209455a76bbb323140c9f4c790801
Eliminate unnecessary fsm->path/opath shuffle on backup renaming

- Makes the code much more obvious to follow since we're not swapping
  path/opath back and forwards just to be able to use a throwaway
  path for the rename. Dont bother null-checking on logging,
  if one of the paths was null we'd be dead already.
- Also fixes an ancient memleak: when osuffix is in use, fsm->path
  gets newly malloced before fsmVerify() but this part did another
  allocation on it, didn't save and restore fsm->path .. and nothing
  was freeing the original (local) allocation of fsm->path, only
  restoring the previous value.
lib/fsm.c