Coverage Report

Created: 2025-06-22 06:18

/src/h2o/deps/libyrmcds/close.c
Line
Count
Source (jump to first uncovered line)
1
// (C) 2013 Cybozu.
2
3
#include "yrmcds.h"
4
5
#include <stdlib.h>
6
#include <unistd.h>
7
8
0
yrmcds_error yrmcds_close(yrmcds* c) {
9
0
    if( c == NULL )
10
0
        return YRMCDS_BAD_ARGUMENT;
11
0
    if( c->sock == -1 )
12
0
        return YRMCDS_OK;
13
14
0
    close(c->sock);
15
0
    c->sock = -1;
16
0
#ifndef LIBYRMCDS_NO_INTERNAL_LOCK
17
0
    pthread_mutex_destroy(&(c->lock));
18
0
#endif
19
0
    free(c->recvbuf);
20
0
    c->recvbuf = NULL;
21
0
    free(c->decompressed);
22
0
    c->decompressed = NULL;
23
0
    return YRMCDS_OK;
24
0
}