Changes in conf.c [5ebff60:2f8e3ca]
Legend:
- Unmodified
- Added
- Removed
-
conf.c
r5ebff60 r2f8e3ca 37 37 38 38 static int conf_loadini(conf_t *conf, char *file); 39 static void conf_free(conf_t *conf); 39 40 40 41 conf_t *conf_load(int argc, char *argv[]) … … 73 74 if (i == 0) { 74 75 fprintf(stderr, "Error: Syntax error in configuration file `%s'.\n", global.conf_file); 76 conf_free(conf); 75 77 return NULL; 76 78 } else if (i == -1) { … … 104 106 g_free(global.conf_file); 105 107 global.conf_file = g_strdup(optarg); 106 g_free(conf);108 conf_free(conf); 107 109 /* Re-evaluate arguments. Don't use this option twice, 108 110 you'll end up in an infinite loop! Hope this trick … … 135 137 " -h Show this help page.\n" 136 138 " -V Show version info.\n"); 139 conf_free(conf); 137 140 return NULL; 138 141 } else if (opt == 'V') { 139 printf("BitlBee %s\nAPI version %06x\n", 140 BITLBEE_VERSION, BITLBEE_VERSION_CODE); 142 printf("BitlBee %s\nAPI version %06x\nConfigure args: %s\n", 143 BITLBEE_VERSION, BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS); 144 conf_free(conf); 141 145 return NULL; 142 146 } else if (opt == 'u') { … … 162 166 they're secure when in fact they're not. */ 163 167 fprintf(stderr, "Error: Could not read CA file %s: %s\n", conf->cafile, strerror(errno)); 168 conf_free(conf); 164 169 return NULL; 165 170 } 166 171 167 172 return conf; 173 } 174 175 static void conf_free(conf_t *conf) 176 { 177 /* Free software means users have the four essential freedoms: 178 0. to run the program, 179 2. to study and change the program in source code form, 180 2. to redistribute exact copies, and 181 3. to distribute modified versions 182 */ 183 g_free(conf->auth_pass); 184 g_free(conf->cafile); 185 g_free(conf->configdir); 186 g_free(conf->ft_listen); 187 g_free(conf->hostname); 188 g_free(conf->iface_in); 189 g_free(conf->iface_out); 190 g_free(conf->motdfile); 191 g_free(conf->oper_pass); 192 g_free(conf->pidfile); 193 g_free(conf->plugindir); 194 g_free(conf->port); 195 g_free(conf->primary_storage); 196 g_free(conf->user); 197 g_strfreev(conf->migrate_storage); 198 g_strfreev(conf->protocols); 199 g_free(conf); 200 168 201 } 169 202 … … 219 252 g_free(conf->configdir); 220 253 conf->configdir = g_strdup(ini->value); 254 } else if (g_strcasecmp(ini->key, "plugindir") == 0) { 255 g_free(conf->plugindir); 256 conf->plugindir = g_strdup(ini->value); 221 257 } else if (g_strcasecmp(ini->key, "motdfile") == 0) { 222 258 g_free(conf->motdfile); … … 259 295 } else if (url->proto == PROTO_SOCKS5) { 260 296 proxytype = PROXY_SOCKS5; 297 } else if (url->proto == PROTO_SOCKS4A) { 298 proxytype = PROXY_SOCKS4A; 261 299 } 262 300
Note: See TracChangeset
for help on using the changeset viewer.