[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed May 7 23:44:30 CEST 2003


CVS commit by staikos: 

better be safe with free()


  M +16 -8     kstrvector.cpp   1.9


--- kdeextragear-2/kst/kst/kstrvector.cpp  #1.8:1.9
@@ -184,6 +184,8 @@ void KstRVector::change(KstFile *in_file
   SPF = File->samplesPerFrame(Field.latin1());
 
+  if (V) {
   free(V);
   V = 0L;
+  }
 
   if (ReqNF>0) {  // allocate the vector
@@ -210,6 +212,8 @@ void KstRVector::changeFile(KstFile *in_
   SPF = File->samplesPerFrame(Field.latin1());
 
+  if (V) {
   free(V);
   V = 0L;
+  }
 
   if (ReqNF>0) {  // allocate the vector
@@ -250,6 +254,8 @@ void KstRVector::changeFrames(const int 
   SPF = File->samplesPerFrame(Field.latin1());
 
+  if (V) {
   free(V);
   V = 0L;
+  }
 
   if (ReqNF>0) {  // allocate the vector
@@ -271,6 +277,8 @@ KstRVector::~KstRVector(){
   File->decUsage();  // deregister from the file
 
+  if (V) {
   free(V);
   V = 0L;
+  }
 
   if (AveReadBuf!=NULL) {




More information about the Kst mailing list