Using the standard macro will facilitate the conversion to glib's
auto cleanup macros.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
return act;
error:
- virSystemdActivationFree(&act);
+ virSystemdActivationFree(act);
return NULL;
}
* associated with the activation object
*/
void
-virSystemdActivationFree(virSystemdActivationPtr *act)
+virSystemdActivationFree(virSystemdActivationPtr act)
{
- if (!*act)
+ if (!act)
return;
- virHashFree((*act)->fds);
+ virHashFree(act->fds);
- VIR_FREE(*act);
+ VIR_FREE(act);
}
#pragma once
#include "internal.h"
+#include "virautoclean.h"
typedef struct _virSystemdActivation virSystemdActivation;
typedef virSystemdActivation *virSystemdActivationPtr;
int **fds,
size_t *nfds);
-void virSystemdActivationFree(virSystemdActivationPtr *act);
+void virSystemdActivationFree(virSystemdActivationPtr act);
-#define virSystemdActivationAutoPtrFree virSystemdActivationFree
+VIR_DEFINE_AUTOPTR_FUNC(virSystemdActivation, virSystemdActivationFree);
if (act != NULL) {
fprintf(stderr, "Unexpectedly got activation object");
- virSystemdActivationFree(&act);
+ virSystemdActivationFree(act);
return -1;
}