Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Avoid variable length local array
details: https://anonhg.NetBSD.org/src/rev/d44e56a5702f
branches: trunk
changeset: 457249:d44e56a5702f
user: martin <martin%NetBSD.org@localhost>
date: Mon Jun 17 17:53:41 2019 +0000
description:
Avoid variable length local array
diffstat:
usr.sbin/sysinst/partman.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (34 lines):
diff -r 060c4b28b135 -r d44e56a5702f usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c Mon Jun 17 17:53:22 2019 +0000
+++ b/usr.sbin/sysinst/partman.c Mon Jun 17 17:53:41 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.32 2019/06/12 06:20:18 martin Exp $ */
+/* $NetBSD: partman.c,v 1.33 2019/06/17 17:53:41 martin Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -292,6 +292,7 @@
void *dev_ptr, int dev_ptr_delta, structinfo_t *s)
{
int i, ok = 0;
+ menu_ent *menu_entries;
if (dev_ptr == NULL) {
/* We should create new device */
@@ -308,7 +309,7 @@
}
}
- menu_ent menu_entries[menu_entries_count];
+ menu_entries = calloc(menu_entries_count, sizeof *menu_entries);
for (i = 0; i < menu_entries_count - 1; i++)
menu_entries[i] = (menu_ent) { .opt_menu=OPT_NOMENU,
.opt_action=action };
@@ -324,6 +325,7 @@
process_menu(menu_no, dev_ptr);
free_menu(menu_no);
+ free(menu_entries);
return check_fun(dev_ptr);
}
Home |
Main Index |
Thread Index |
Old Index