Skip to content

Commit

Permalink
sysroot: Make coverity happy with dirname+strdup
Browse files Browse the repository at this point in the history
Similar to d528083 - I don't
believe we actually had a leak here because `dirname` always
returns the same start pointer, but this makes Coverity
happy.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Aug 15, 2024
1 parent 0d5e554 commit 70430fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libostree/ostree-sysroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2243,7 +2243,8 @@ ostree_sysroot_deployment_unlock (OstreeSysroot *self, OstreeDeployment *deploym
deployment, _OSTREE_SYSROOT_DEPLOYMENT_RUNSTATE_FLAG_DEVELOPMENT)
: _ostree_sysroot_get_runstate_path (
deployment, _OSTREE_SYSROOT_DEPLOYMENT_RUNSTATE_FLAG_TRANSIENT);
g_autofree char *devpath_parent = dirname (g_strdup (devpath));
g_autofree char *devpath_parent_owned = g_strdup (devpath);
const char *devpath_parent = dirname (devpath_parent_owned);

if (!glnx_shutil_mkdir_p_at (AT_FDCWD, devpath_parent, 0755, cancellable, error))
return FALSE;
Expand Down

0 comments on commit 70430fe

Please sign in to comment.