Sometimes vnodepath is set to a local buffer. Sometimes it is set
to malloc'ed storage. Simplify the logic for freeing vnodepath
by checking explicitly for this condition rather than the state
of other variables. As a bonus, avoids a false (?) positive from
the static analyzer.
Change-Id: I3772cb97698acc5a6ac1f438977c673e6fea7722
Reviewed-on: http://gerrit.openafs.org/7869
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
|| (r =
xfopen_path(&OX, O_RDWR | O_CREAT | O_TRUNC, vnodepath + 1,
0644))) {
- if (!use_vnum)
+ if (vnodepath != vnpx)
free(vnodepath);
return r;
}
} else
r = 0;
- if (!use_vnum && use != 2)
+ if (vnodepath != vnpx)
free(vnodepath);
return r;
}
}
if (!(linktarget = malloc(v->size + 1))) {
- if (!use_vnum && use != 2)
+ if (vnodepath != vnpx)
free(vnodepath);
return DSERR_MEM;
}
if ((r = xftell(X, &where))
|| (r = xfseek(X, &v->d_offset))
|| (r = xfread(X, linktarget, v->size))) {
- if (!use_vnum && use != 2)
+ if (vnodepath != vnpx)
free(vnodepath);
free(linktarget);
return r;
}
free(linktarget);
- if (!use_vnum && use != 2)
+ if (vnodepath != vnpx)
free(vnodepath);
return r;
}