提交 f61870f6 编写于 作者: S Sukrit Bhatnagar 提交者: Erik Skultety

util: bitmap: use VIR_AUTOPTR for aggregate types

By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.
Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 a3c915e6
......@@ -1202,15 +1202,12 @@ char *
virBitmapDataFormat(const void *data,
int len)
{
virBitmapPtr map = NULL;
char *ret = NULL;
VIR_AUTOPTR(virBitmap) map = NULL;
if (!(map = virBitmapNewData(data, len)))
return NULL;
ret = virBitmapFormat(map);
virBitmapFree(map);
return ret;
return virBitmapFormat(map);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册