]>
Commit | Line | Data |
---|---|---|
3f61e419 MWP |
1 | |
2 | # HG changeset patch | |
3 | # User Vincent Wagelaar <vincent@ricardis.tudelft.nl> | |
4 | # Date 1195499691 -3600 | |
5 | # Node ID bfe5900f95a82b60a488a75d73451e3130c8b9c5 | |
6 | # Parent 36cbf3b25cb6712e00b517c0ee98177096ddf83e | |
7 | Free wg when context init fails patch by Evgeniy Dushistov | |
8 | ||
9 | --- a/cache.c Mon Nov 19 20:01:08 2007 +0100 | |
10 | +++ b/cache.c Mon Nov 19 20:14:51 2007 +0100 | |
11 | @@ -286,13 +286,14 @@ static void *workgroup_listing_thread(vo | |
12 | ||
13 | hash_t *ip_cache = hash_create(HASHCOUNT_T_MAX, NULL, NULL); | |
14 | if (NULL == ip_cache) | |
15 | - return NULL; | |
16 | - | |
17 | + { | |
18 | + goto out; | |
19 | + } | |
20 | stringlist_t *servers = sl_init(); | |
21 | if (NULL == servers) | |
22 | { | |
23 | fprintf(stderr, "Malloc failed\n"); | |
24 | - return NULL; | |
25 | + goto out; | |
26 | } | |
27 | SMBCCTX *ctx = fusesmb_cache_new_context(&cfg); | |
28 | SMBCFILE *dir; | |
29 | @@ -377,7 +378,9 @@ use_popen: | |
30 | hash_destroy(ip_cache); | |
31 | sl_free(servers); | |
32 | smbc_free_context(ctx, 1); | |
33 | - return 0; | |
34 | +out: | |
35 | + free(wg); | |
36 | + return NULL; | |
37 | } | |
38 | ||
39 | ||
40 | @@ -552,6 +555,7 @@ int main(int argc, char *argv[]) | |
41 | cache_servers(ctx); | |
42 | smbc_free_context(ctx, 1); | |
43 | options_free(&opts); | |
44 | + config_free(&cfg); | |
45 | if (argc == 1) | |
46 | { | |
47 | unlink(pidfile); | |
48 |