#13875: Test memory allocation in distances_all_pairs
---------------------------------+------------------------------------------
       Reporter:  dcoudert       |         Owner:  jason, ncohen, rlm
           Type:  enhancement    |        Status:  needs_work        
       Priority:  major          |     Milestone:  sage-5.6          
      Component:  graph theory   |    Resolution:                    
       Keywords:                 |   Work issues:                    
Report Upstream:  N/A            |     Reviewers:                    
        Authors:  David Coudert  |     Merged in:                    
   Dependencies:  #13808         |      Stopgaps:                    
---------------------------------+------------------------------------------
Changes (by ncohen):

  * status:  needs_review => needs_work


Comment:

 `^^;`

 Thanks !

 As before, though, there are memory leaks if `t_prec` is allocated but not
 `prec`.

 {{{
  t_prec = <unsigned short *> sage_malloc(n*n*sizeof(short))
  if t_prec==NULL:
      raise MemoryError()
  prec = <unsigned short **> sage_malloc(n*sizeof(short *))
  if prec==NULL:
      raise MemoryError()
 }}}

 You should add a `sage_free(t_prec)` before the second `raise
 MemoryError()`, and it hppens several timees in the file.

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13875#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to