Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Free Null Pointer  at cmds.c:672

Categories: LANG.ALLOC.FNP CWE:590
Warning ID: 2914.2996
Procedure: add_cmd
Trace: View
Modified: Wed Sep 2 12:52:42 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/pvm/pvm3/console/cmds.c
   Enter add_cmd
 632 add_cmd(ac, av) 
 633         int ac;
 634         char **av;
 635 {
 636         int diagnose = 0;
 637         int cc;
 638         int *sv;
 639         int i;
 640  
 641         av++;
 642         ac--;
true643         sv = TALLOC(ac, int, "int");
 644         if ((cc = pvm_addhosts(av, ac, sv)) >= 0) {
 645                 if (cc > 0)
 646                         pvm_recv(-1, HostsAddedTag); /* waste the notify message */ 
 647  
 648                 printf("%d successful\n", cc);
 649                 fputs("                    HOST     DTID\n", stdout);
 650                 for (i = 0; i < ac; i++)
 651                         if ((cc = sv[i]) < 0) {   /* Null Pointer Dereference (ID: 2915.2997) */
 652                                 printf("%24s %8s\n", av[i], PVMERRMSG(cc));
 653                                 if (cc == PvmCantStart)
 654                                         diagnose++;
 655                         }
 656                         else 
 657                                 printf("%24s %8x\n", av[i], cc);
 658  
 659                 /* Try to Further Diagnose "PvmCantStart" Cases... */ 
 660                 /* Otherwise, sure to generate MORE BUG MAIL!!!  :-Q */ 
 661                 if ( diagnose ) {
 662                         printf( "\nAuto-Diagnosing Failed Hosts...\n" );
 663                         for (i = 0; i < ac; i++) {
 664                                 if (sv[i] == PvmCantStart) {
 665                                         printf( "%s...\n", av[i] );
 666                                         diagnose_cant_start_pvm( av[i);
 667                                         printf( "\n" );
 668                                 }
 669                         }
 670                 }
 671         }
sv <= 4095672         MY_FREE(sv);     /* Free Null Pointer */
Preconditions
$param_1 = 1
&$unknown_3273303 >= 1
pvmautoerr != 2
pvmautoerr != 3
Postconditions
ac' = $param_1 - 1
av' = $param_2 + 8
cc' = &$unknown_3273303
diagnose' = 0
i' = 0
sv' = 0




Change Warning 2914.2996 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: