Changes in conf.c [2f8e3ca:5ebff60]
Legend:
- Unmodified
- Added
- Removed
-
conf.c
r2f8e3ca r5ebff60 37 37 38 38 static int conf_loadini(conf_t *conf, char *file); 39 static void conf_free(conf_t *conf);40 39 41 40 conf_t *conf_load(int argc, char *argv[]) … … 74 73 if (i == 0) { 75 74 fprintf(stderr, "Error: Syntax error in configuration file `%s'.\n", global.conf_file); 76 conf_free(conf);77 75 return NULL; 78 76 } else if (i == -1) { … … 106 104 g_free(global.conf_file); 107 105 global.conf_file = g_strdup(optarg); 108 conf_free(conf);106 g_free(conf); 109 107 /* Re-evaluate arguments. Don't use this option twice, 110 108 you'll end up in an infinite loop! Hope this trick … … 137 135 " -h Show this help page.\n" 138 136 " -V Show version info.\n"); 139 conf_free(conf);140 137 return NULL; 141 138 } else if (opt == 'V') { 142 printf("BitlBee %s\nAPI version %06x\nConfigure args: %s\n", 143 BITLBEE_VERSION, BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS); 144 conf_free(conf); 139 printf("BitlBee %s\nAPI version %06x\n", 140 BITLBEE_VERSION, BITLBEE_VERSION_CODE); 145 141 return NULL; 146 142 } else if (opt == 'u') { … … 166 162 they're secure when in fact they're not. */ 167 163 fprintf(stderr, "Error: Could not read CA file %s: %s\n", conf->cafile, strerror(errno)); 168 conf_free(conf);169 164 return NULL; 170 165 } 171 166 172 167 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, and181 3. to distribute modified versions182 */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 201 168 } 202 169 … … 252 219 g_free(conf->configdir); 253 220 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);257 221 } else if (g_strcasecmp(ini->key, "motdfile") == 0) { 258 222 g_free(conf->motdfile); … … 295 259 } else if (url->proto == PROTO_SOCKS5) { 296 260 proxytype = PROXY_SOCKS5; 297 } else if (url->proto == PROTO_SOCKS4A) {298 proxytype = PROXY_SOCKS4A;299 261 } 300 262
Note: See TracChangeset
for help on using the changeset viewer.