}
Guard(Guard &&g) : fun(std::move(g.fun)), active(g.active) {
- dismiss();
+ g.dismiss();
}
};
#include <linux/limits.h>
#include <memory>
#include <mutex>
+#include <new>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>
static inline kconn *get_shared(BusType bus_type, int fd)
{
- kconn *result = new kconn(Checker::get(bus_type).checker(), fd);
+ kconn *result = new (std::nothrow) kconn(Checker::get(bus_type).checker(), fd);
if (nullptr == result)
LOGE("Error: failed to allocate memory for policy configuration");
return result;