From 0ec649e584687e3ef4491051746cb52907d58209 Mon Sep 17 00:00:00 2001 From: "V.Krishn" Date: Thu, 12 Mar 2015 22:32:22 +0530 Subject: minor clean, bugfix --- client_shared.c | 5 +++++ client_shared.h | 2 ++ sub_client.c | 6 ++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client_shared.c b/client_shared.c index 945b2fb..8862208 100644 --- a/client_shared.c +++ b/client_shared.c @@ -94,6 +94,11 @@ void client_config_cleanup(struct mosq_config *cfg) if(cfg->socks5_username) free(cfg->socks5_username); if(cfg->socks5_password) free(cfg->socks5_password); #endif + + if(cfg->ffmask) free(cfg->ffmask); + if(cfg->ftoken) free(cfg->ftoken); + if(cfg->fmask_topic) free(cfg->fmask_topic); + } int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) diff --git a/client_shared.h b/client_shared.h index 3f8b14b..8fdaa8b 100644 --- a/client_shared.h +++ b/client_shared.h @@ -1,5 +1,6 @@ /* Copyright (c) 2014 Roger Light +Copyright (c) 2015 V.Krishn All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -12,6 +13,7 @@ and the Eclipse Distribution License is available at Contributors: Roger Light - initial implementation and documentation. + V Krishn - implement dirpub. */ #ifndef _CLIENT_CONFIG_H diff --git a/sub_client.c b/sub_client.c index 2a44f3a..95d6580 100644 --- a/sub_client.c +++ b/sub_client.c @@ -168,7 +168,7 @@ const char *datetime(int fmt) /* Expand/resolve fmask token string. */ /* ------------------------------------------------------------- */ -void *_setfmask(char *token, void *obj) +void _setfmask(char *token, void *obj) { struct mosq_config *cfg; @@ -238,13 +238,12 @@ void *_setfmask(char *token, void *obj) } to[strlen(to)-1] = '\0'; - return 0; } /* Expand --fmask string options for output filename. */ /* ------------------------------------------------------------- */ -void *_fmask(char *fmask, void *obj) +void _fmask(char *fmask, void *obj) { struct mosq_config *cfg; @@ -271,7 +270,6 @@ void *_fmask(char *fmask, void *obj) } to[strlen(to)-1] = '\0'; - return 0; } -- cgit v1.2.3