~ubuntu-branches/ubuntu/feisty/wpasupplicant/feisty

« back to all changes in this revision

Viewing changes to main.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2007-04-01 10:53:37 UTC
  • Revision ID: james.westby@ubuntu.com-20070401105337-3dd89n3g8ecdhjsl
Tags: 0.5.7-0ubuntu2
Apply patch from upstream after private email discussion:
http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=33673d3f43da6f5ec0f0aa5a8245a1617b6eb2fd#patch1
Fixes LP: #98895, #98925

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        if (os_program_init())
133
133
                return -1;
134
134
 
135
 
        os_memset(&params, 0, sizeof(params));
 
135
        memset(&params, 0, sizeof(params));
136
136
        params.wpa_debug_level = MSG_INFO;
137
137
 
138
 
        iface = ifaces = os_zalloc(sizeof(struct wpa_interface));
 
138
        iface = ifaces = wpa_zalloc(sizeof(struct wpa_interface));
139
139
        if (ifaces == NULL)
140
140
                return -1;
141
141
        iface_count = 1;
191
191
                        iface->driver_param = optarg;
192
192
                        break;
193
193
                case 'P':
194
 
                        os_free(params.pid_file);
195
194
                        params.pid_file = os_rel2abs_path(optarg);
196
195
                        break;
197
196
                case 'q':
216
215
                        break;
217
216
                case 'N':
218
217
                        iface_count++;
219
 
                        iface = os_realloc(ifaces, iface_count *
220
 
                                           sizeof(struct wpa_interface));
 
218
                        iface = realloc(ifaces, iface_count *
 
219
                                        sizeof(struct wpa_interface));
221
220
                        if (iface == NULL)
222
221
                                goto out;
223
222
                        ifaces = iface;
224
223
                        iface = &ifaces[iface_count - 1]; 
225
 
                        os_memset(iface, 0, sizeof(*iface));
 
224
                        memset(iface, 0, sizeof(*iface));
226
225
                        break;
227
226
                default:
228
227
                        usage();
235
234
        if (global == NULL) {
236
235
                printf("Failed to initialize wpa_supplicant\n");
237
236
                exitcode = -1;
238
 
                goto out;
239
237
        }
240
238
 
241
239
        for (i = 0; exitcode == 0 && i < iface_count; i++) {
259
257
        wpa_supplicant_deinit(global);
260
258
 
261
259
out:
262
 
        os_free(ifaces);
263
 
        os_free(params.pid_file);
 
260
        free(ifaces);
 
261
        free(params.pid_file);
264
262
 
265
263
        os_program_deinit();
266
264