]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
edit: Fix libreadline history clearing with WPA_TRACE
authorJouni Malinen <j@w1.fi>
Tue, 14 May 2013 13:46:38 +0000 (16:46 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 14 May 2013 13:46:38 +0000 (16:46 +0300)
The HIST_ENTRY and its variables are allocated within libreadline, so
they won't have the WPA_TRACE special header and cannot be freed with
os_free(). Use free() to avoid issues during wpa_cli termination if any
of the new commands added to the history are to be removed (e.g.,
set_network could include a password).

Signed-hostap: Jouni Malinen <j@w1.fi>

src/utils/edit_readline.c

index add26fa33737a0b00b19b11598979cf06b4425e1..c2a5bcaa1785276b65d5f5099c08d989ce1bf0e5 100644 (file)
@@ -167,9 +167,9 @@ void edit_deinit(const char *history_file,
                        if (filter_cb && filter_cb(edit_cb_ctx, p)) {
                                h = remove_history(where_history());
                                if (h) {
-                                       os_free(h->line);
+                                       free(h->line);
                                        free(h->data);
-                                       os_free(h);
+                                       free(h);
                                } else
                                        next_history();
                        } else