On 10/11/2011 10:20 PM, Laine Stump wrote:
From: Laine Stump<laine(a)vlap.laine.org>
The following errors appeared when I began building on Fedora 16. In
all cases, the variables really are never used, so they've been
removed.
+++ b/src/drv_redhat.c
@@ -166,11 +166,10 @@ static char *find_ifcfg_path_by_hwaddr(struct netcf *ncf, const
char *mac) {
* interface by checking for an entry 'DEVICE=NAME'
*/
static char *find_ifcfg_path_by_device(struct netcf *ncf, const char *name) {
- struct augeas *aug = NULL;
int ndevs = 0;
char **devs = NULL;
- aug = get_augeas(ncf);
+ get_augeas(ncf);
I had to look, but it does indeed look like get_augeas is useful for its
side effects of initializing a member of ncf. But are you risking a
NULL dereference if the initialization failed? That is, should you be
using ERR_THROW(!get_augeas(ncf), ncf, E..., "failed to get augeas")
instead of blindly ignoring the return value?
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org