summaryrefslogtreecommitdiff
path: root/src/libwpactrl/wpactrl_end.c
blob: 0dbe98b6eb303788044de9d7657d01232703654b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ISC license. */

#include <skalibs/posixplz.h>
#include <skalibs/stralloc.h>
#include <skalibs/djbunix.h>

#include <bcnm/wpactrl.h>

void wpactrl_end (wpactrl_t *a)
{
  if (a->clientpath.s)
  {
    a->clientpath.s[a->clientpath.len - 2] = 's' ;
    unlink_void(a->clientpath.s) ;
    a->clientpath.s[a->clientpath.len - 2] = 'a' ;
    unlink_void(a->clientpath.s) ;
    stralloc_free(&a->clientpath) ;
  }
  fd_close(a->fda) ;
  fd_close(a->fds) ;
  stralloc_free(&a->filters) ;
  stralloc_free(&a->data) ;
  *a = wpactrl_zero ;
}