提交 03970217 编写于 作者: J John Ferlan

Revert "nwfilter: Fix possible segfault on sometimes consumed variable"

This reverts commit 6209bb32.

This turns out to be the wrong adjustment
上级 513f0982
......@@ -26,9 +26,7 @@
#include "internal.h"
#include "viralloc.h"
#include "virerror.h"
#include "virstring.h"
#include "datatypes.h"
#include "nwfilter_params.h"
#include "nwfilter_ipaddrmap.h"
......@@ -54,7 +52,6 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr)
{
int ret = -1;
virNWFilterVarValuePtr val;
char *tmp = NULL;
virMutexLock(&ipAddressMapLock);
......@@ -68,18 +65,14 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr)
virNWFilterVarValueFree(val);
goto cleanup;
} else {
if (VIR_STRDUP(tmp, addr) < 0)
if (virNWFilterVarValueAddValue(val, addr) < 0)
goto cleanup;
if (virNWFilterVarValueAddValue(val, tmp) < 0)
goto cleanup;
tmp = NULL;
}
ret = 0;
cleanup:
virMutexUnlock(&ipAddressMapLock);
VIR_FREE(tmp);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册