aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modutils/modprobe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index a510f69e8..6a3e06df4 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -354,7 +354,7 @@ static int mod_insert ( char *mod, int argc, char **argv )
354 for ( i = 0; i < argc; i++ ) 354 for ( i = 0; i < argc; i++ )
355 l += ( xstrlen ( argv [i] ) + 1 ); 355 l += ( xstrlen ( argv [i] ) + 1 );
356 356
357 head-> m_module = realloc ( head-> m_module, l + 1 ); 357 head-> m_module = xrealloc ( head-> m_module, l + 1 );
358 358
359 for ( i = 0; i < argc; i++ ) { 359 for ( i = 0; i < argc; i++ ) {
360 strcat ( head-> m_module, " " ); 360 strcat ( head-> m_module, " " );
@@ -440,7 +440,7 @@ extern int modprobe_main(int argc, char** argv)
440 440
441 if (remove_opt) { 441 if (remove_opt) {
442 do { 442 do {
443 mod_remove ( optind < argc ? argv [optind] : 0 ); 443 mod_remove ( optind < argc ? xstrdup ( argv [optind] ) : 0 );
444 } while ( ++optind < argc ); 444 } while ( ++optind < argc );
445 445
446 return EXIT_SUCCESS; 446 return EXIT_SUCCESS;
@@ -449,7 +449,7 @@ extern int modprobe_main(int argc, char** argv)
449 if (optind >= argc) 449 if (optind >= argc)
450 error_msg_and_die ( "No module or pattern provided\n" ); 450 error_msg_and_die ( "No module or pattern provided\n" );
451 451
452 return mod_insert ( argv [optind], argc - optind - 1, argv + optind + 1 ) ? \ 452 return mod_insert ( xstrdup ( argv [optind] ), argc - optind - 1, argv + optind + 1 ) ? \
453 EXIT_FAILURE : EXIT_SUCCESS; 453 EXIT_FAILURE : EXIT_SUCCESS;
454} 454}
455 455